NOT EXISTS
True if subquery returns no rows.
sql
1SELECT * FROM courses c
2WHERE NOT EXISTS (
3 SELECT 1 FROM students WHERE course_id = c.id
4);Courses without students.

True if subquery returns no rows.
1SELECT * FROM courses c
2WHERE NOT EXISTS (
3 SELECT 1 FROM students WHERE course_id = c.id
4);Courses without students.