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);
Find courses that have students.
1SELECT course_name FROM courses c
2WHERE EXISTS (
3 SELECT 1 FROM students WHERE course_id = c.id
4);