Best April deals - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
GROUP BY – Recap
5. Grouping by multiple columns
Summary

Instruction

Great! Okay, we know how well each contestant did in general, but we would also like to know how well they did on average in each category. To achieve that, we can add another column to the GROUP BY clause:

SELECT
  full_name,
  category, 
  AVG(score) AS avg_score
FROM contest_score
GROUP BY full_name, category;

With this addition, we will now get each contestant's average score in each category.

Exercise

How much, in total, was spent on deliveries for each category on each day? Show three columns: category, delivery_date, and the sum of total_price (rename the column total).

Stuck? Here's a hint!

Group by category and delivery_date.