Exercise: Sort Joined Data
Sort by course then student name.
Solution
sql
1SELECT c.course_name, s.name
2FROM students s
3JOIN courses c ON s.course_id = c.id
4ORDER BY c.course_name, s.name;
Sort by course then student name.
1SELECT c.course_name, s.name
2FROM students s
3JOIN courses c ON s.course_id = c.id
4ORDER BY c.course_name, s.name;