Deals Of The Week - 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
 FullName,
 Category, 
 AVG(Score) AS AvgScore
FROM ContestScore
GROUP BY FullName, 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, DeliveryDate, and the sum of TotalPrice (rename the column Total).

Stuck? Here's a hint!

Group by Category and DeliveryDate.