I have 2 tables: teacher, & class. here's the descriptions:
TEACHER
----------------
TEACHER_ID
FIRST_NAME
LAST_NAME
TYPE_CODE
HOME_ROOM_NUM
PHONE_NUM
START_DATE
HOME_STATE
SCHOOL_ID
Class
--------------------
CLASS_ID
CLASS_NAME
TEACHER_ID
MAX_SEATS_AVAILABLE
Im trying to figure out how to count the number of classes a given teacher teaches. here's what I have tried: 1. How many classes does Lisa Jones teach, if any?
SQL> select teacher.last_name, teacher.first_name, class.class_name as
2 from teacher, class
3 where teacher.teacher_id = '2'
4 AND class.teacher_id = '2';
here's the result I get:
LAST_NAME FIRST_NAME CLASS_ID CLASS_NAME TEACHER_ID MAX_SEATS_AVAILABLE
----------------- ----------------- -------- -------------------- ----------- --------------------
JONES LISA 2 Basic CALCULUS 2 10
JONES LISA 9 Physics 230 2 20
I just need teacher name, Id, and # of classes, not having any luck w/ the COUNT function.