Skip
Arish's avatar

227. Practice - NOT EXISTS


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);