Sorting Grouped Results
sql
1SELECT course, COUNT(*) AS count
2FROM students
3GROUP BY course
4ORDER BY count DESC;Most popular courses first.

1SELECT course, COUNT(*) AS count
2FROM students
3GROUP BY course
4ORDER BY count DESC;Most popular courses first.