Chapter 4 · Aggregations
46. Categories with Many Products
Medium20 XPE-Commerce
The inventory manager needs to identify product-heavy categories. Find all categories that have more than 5 products. Return the category_id, category name, and product count, sorted by product count (highest first).
Tables
- PKidINT
- nameTEXT
- descriptionTEXT
- PKidINT
- nameTEXT
- FKcategory_id→ categories.idINT
- priceREAL
- costREAL
- stock_quantityINT
- created_atTIMESTAMP
Need help?
Ask Sol
AI tutor — looks at your current query and nudges you, without spoiling the answer.
Solution
Try the hints first — solving it yourself is what makes it stick.