Instruction
Good job! Let's do one more exercise before we go to the next kind of multi-level aggregation.
Exercise
What is the average number of products in non-vegetarian (CategoryID 6 or 8) and vegetarian categories (all other CategoryID values)? Show two columns: ProductType (either N'vegetarian' or N'non-vegetarian') and AvgProductCount.
Stuck? Here's a hint!
In the inner query, create a CASE WHEN expression to check the CategoryID value and show either N'non-vegetarian' or N'vegetarian'. Then, in the outer query, use that column with the AVG() function. You need to use only one table – Products.




