Suppose I have three tables Student, Class, Student_Class(linking table).
Table:Student
Student_ID
FirstName
LastName
Table:Class
Class_ID
Class_name
Table:Student_Class (Linking Table)
StudentClass_ID
Class_ID
Student_IDGiven a particular Class_ID, I want to know everything about the students who are not registered for that particular class.
I tried the following but it does not work. Lets say I try for class id = 3
SELECT DISTINCT Student.*
FROM Student
INNER JOIN Student_Class
ON Student.Student_ID = Student_Class.Student_ID
WHERE ((NOT (Student_Class.Class_ID)= 3))