I have two tables defined as follow:
Courses
course ID course Name
1 Math
2 Science
3 geography
and another table (its use is to show enrolled students in courses):
student_courses
course ID student ID Final cost
1 2 100
2 3 200
I need a SQL statement that selects only the courses that a certain student (its value is a parameter from a control on my page -but that is not my problem) isn’t enrolled in….
My latest try is this:
SELECT
Courses.[Course ID], Courses.[Course name]
FROM
Courses, student_courses
where
Courses.[Course ID] <> student_courses.[Course ID]
1 Answer