This is a post posted on the Forum. If no answer is answered, put it here first...
Select sname
From student
Where not exists
(Select *
From Course
Where not exists
(Select *
From SC
Where SC. Sno = student. SnO and SC. CNO = course. CNO );
In general, I know that not exists applies to all students who have not selected a course, but the program cannot understand it:
For example, the inmost query statement shows the course selection information of all students who have selected courses. Because all students here, it does not mean that all courses may be included, so does the next not exists nesting get a course that not all students have chosen?
Is there another way of writing? Is it feasible? "count (*) = count ([s #])" I don't understand what I got.
Select Sn, SD from S
Where [s #] In (
Select [s #] from SC
Right join
C On SC. [C #] = C. [C #] group by [s #]
Having count (*) = count ([s #])