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 (category_id 6 or 8) and vegetarian categories (all other category_id values)? Show two columns: product_type (either 'vegetarian' or 'non-vegetarian') and avg_product_count.
Stuck? Here's a hint!
In the inner query, create a CASE WHEN expression to check the category_id value and show either 'non-vegetarian' or 'vegetarian'. Then, in the outer query, use that column with the AVG() function. You need to use only one table – products.



