I need a query that will display the students who have enrolled in all the courses. I am working with the following tables:
STUDENTS(SID,FNAME,LNAME)
CATALOG(CNO,CTITLE)
COURSES(TERM,LINENO,CNO)
ENROLLS(SID,TERM,LINENO)
I can display the number of courses each student has enrolled in by using the following query:
SELECT STUDENTS.SID
FROM STUDENTS, ENROLLS
WHERE STUDENTS.SID = ENROLLS.SID
GROUP BY STUDENTS.LNAME
ORDER BY SUM(ENROLLS.SID) DESC;
Unfortunately I can't figure out how to display the students who have enrolled in all the courses. Can someone please offer some suggestions?
STUDENTS(SID,FNAME,LNAME)
CATALOG(CNO,CTITLE)
COURSES(TERM,LINENO,CNO)
ENROLLS(SID,TERM,LINENO)
I can display the number of courses each student has enrolled in by using the following query:
SELECT STUDENTS.SID
FROM STUDENTS, ENROLLS
WHERE STUDENTS.SID = ENROLLS.SID
GROUP BY STUDENTS.LNAME
ORDER BY SUM(ENROLLS.SID) DESC;
Unfortunately I can't figure out how to display the students who have enrolled in all the courses. Can someone please offer some suggestions?