On January 21th at 14:15 UTC , progression through exercises will be unavailable for 10 minutes due to a planned maintenance break.
Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close


Great! Now we'll use the previous query in a new exercise.


Show the name and number of members for each orchestra that has more members than the average membership of all orchestras in the table.

Stuck? Here's a hint!

First, write the query from the previous exercise and compute the average number of members in all orchestras. This will be our subquery:

  (SELECT orchestra_id, COUNT(id) FROM members GROUP BY 1) d;

Then, write a query which computes the number of members in each orchestra. This will be the outer query.

Finally, use the subquery in the HAVING condition of the outer query. Note that this way you'll have nested subqueries.