Write an SQL query to list all course names in alphabetical order, and for each of them, display the number of books that belong to them, and the number of students that belong to them.
Set the headers for course names, number of books and number of students as course
, numberOfBooks
and numberOfStudents
respectively.
Note
: Display 0
for count of students as well as count of books if there are no matching records for a course.
HINT
: Subqueries can serve as both sides of a JOIN