Instruction
Good! Now we'll show you how to write your own multi-level aggregation query. As we said earlier, we'll go step by step. Let's start with finding the average number of items in each order.
In step one, we'll count the items in each query.
Exercise
Create a simple query (no CTE needed) that will show two columns: OrderID and ItemCount. The ItemCount column should show the sum of quantities of all items in a given order.
Stuck? Here's a hint!
Use the OrderItems table. Group by OrderID and use SUM(Quantity).




