Instruction
Excellent. Now, you may have noticed that when we wrote:
SELECT FullName, Category, AVG(Score) AS AvgScore FROM ContestScore GROUP BY ROLLUP (FullName, Category);
we got the following groupings:
- Average by
FullNameandCategory - Average by
FullName - Overall average
In other words, we saw the FullName average, but we didn't see an average for Category only. That's because the column order matters in ROLLUP. Let's check that out.
Exercise
Run the template query. Note that the order of columns inside the parentheses of ROLLUP has been reversed.
As you can see, we now have the following groupings:
- Average by
FullNameandCategory - Average by
Category - Overall average



