Exercise: Empty Courses
Find courses with no students.
Solution
sql
1SELECT course_name FROM courses c
2WHERE NOT EXISTS (
3 SELECT 1 FROM students WHERE course_id = c.id
4);
Find courses with no students.
1SELECT course_name FROM courses c
2WHERE NOT EXISTS (
3 SELECT 1 FROM students WHERE course_id = c.id
4);