Chapter 6 · Subqueries
47. Products Ordered but Never Reviewed
Hard40 XPE-Commerce
The product team wants to solicit reviews for products that have been sold but never reviewed. Find products that appear in at least one order but have no reviews. Use EXISTS and NOT EXISTS. Return the product id, name, and price, sorted by product 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
- PKidINT
- FKproduct_id→ products.idINT
- FKcustomer_id→ customers.idINT
- ratingINT
- commentTEXT
- review_dateTEXT
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.