Use HAVING to filter aggregated groups and COUNT(DISTINCT) for unique counts
I need to know which product categories have more than 400 total sales transactions. For each qualifying category, show the category name (normalized), the number of distinct products sold, and total transaction count. I only want the busy categories — skip the quiet ones.
Each hint you reveal reduces the XP you can earn. Try the query first.
Normalize category with LOWER() to avoid the casing split
Use COUNT(*) for total transactions and COUNT(DISTINCT product_id) for unique products
HAVING COUNT(*) > 400 filters after aggregation — WHERE cannot filter on aggregates