Skip
Arish's avatar

191. Practice - JOIN GROUP 1


Exercise: Count per Course

Count students per course.

Solution

sql
1SELECT c.course_name, COUNT(s.id) AS count
2FROM courses c
3LEFT JOIN students s ON s.course_id = c.id
4GROUP BY c.course_name;