Chapter 5 · JOINs
03. Rarely Ordered Products
Easy10 XPE-Commerce
The inventory team wants to identify slow-moving products. Find all products that have been ordered fewer than 3 times. Return the product name, price, and order_count. Sort by order_count ascending, then by name.
Tables
- PKidINT
- nameTEXT
- FKcategory_id→ categories.idINT
- priceREAL
- costREAL
- stock_quantityINT
- created_atTIMESTAMP
- PKidINT
- FKorder_id→ orders.idINT
- FKproduct_id→ products.idINT
- quantityINT
- unit_priceREAL
- discountREAL
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.