Hi there,
I need help extracting data from three seperate tables. The Tables look like
so:
Courses Table:
COURSE_ID | SUBJECT_TITLE | DESCRIPTION
Scheduled_Cours es Table:
SCHEDULE_ID | START_DATE | END_DATE | COURSE_ID | INSTRUCTOR_ID
Enroll Table:
SCHEDULE_ID | ENROLL_DATE | STUDENT_ID|
What I want to obtain are the ENROLL.SCHEDULE _ID and COURSES.SUBJECT _TITLE
fields when passing the student id to the ENROLL table. The fields named
with an "ID" suffix are just primary and foreign keys. The objective is to
find out which scheduled courses a particular student is already enrolled
in.
I attempted the following which just gives me an empty set:
mysql> SELECT ENROLL.SCHEDULE _ID,COURSES.SUB JECT_TITLE FROM
ENROLL,SCHEDULE D_COU
RSES,COURSES WHERE ENROLL.STUDENT_ ID=36 AND
SCHEDULED_COURS ES.COURSE_ID=CO URSES.COURSE_ID ;
What do I need to change to make this work?
I want to wind up with the following:
_______________ _______________ ___
SCHEDULE_ID | SUBJECT_TITLE
_______________ _______________ ___
32 | Biology 101
_______________ _______________ ___
46 | English 101
Thanks,
Alan Shiers