Skip
Arish's avatar

224. Practice - EXISTS 1


Exercise: Courses With Students

Find courses that have students.

Solution

sql
1SELECT course_name FROM courses c
2WHERE EXISTS (
3  SELECT 1 FROM students WHERE course_id = c.id
4);