JOINS - Complex grouping
43.2
Exercise

Grouping across more than 2 tables

Write a query to display the names of all students who are enrolled in a valid course that has at least one book that belongs to it, and the year of publishing of the oldest book that belongs to the course the student is enrolled in, for each student.

Set the headers for the name of student and the oldest year of publishing as student and oldestPublishingYear respectively.

At the end, make sure that the results are sorted in

  1. the ascending order of oldestPublishingYear, and
  2. the alphabetical order of students’ name.