001Level 1

Chapter 5 · JOINs

74. Customers Who Reviewed Their Purchases

Hard40 XPE-Commerce

The data quality team wants to verify that reviews come from actual buyers. Find all reviews where the reviewer actually purchased the product. Return the customer's full name, product name, rating, and order_date, sorted by customer name, then product name. A customer purchased a product if they have an order containing that product in order_items.

Tables

  • PKidINT
  • first_nameTEXT
  • last_nameTEXT
  • emailTEXT
  • phoneTEXT
  • cityTEXT
  • stateTEXT
  • countryTEXT
  • created_atTIMESTAMP
  • PKidINT
  • nameTEXT
  • FKcategory_id→ categories.idINT
  • priceREAL
  • costREAL
  • stock_quantityINT
  • created_atTIMESTAMP
  • PKidINT
  • FKcustomer_id→ customers.idINT
  • order_dateTEXT
  • statusTEXT
  • total_amountREAL
  • 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.

Peek at the solution?

You can still earn the XP afterwards by submitting a working query — but you'll learn more if you give it one more try.

Chapter 5 · JOINs

0/75
  1. 1Order Details with Customer Name
  2. 2Products with Category Names
  3. 3Rarely Ordered Products
  4. 4Orders with Customer Names
  5. 5Number of Customers Per Branch City
  6. 6Total Interest Paid by Loan Type
  7. 7Customers with Any Frozen Account
  8. 8High-Value Savings Account Holders
  9. 9Patient Visits with Doctor Names
  10. 10Visits That Had Abnormal Lab Results
  11. 11Customers Who Never Ordered
  12. 12Order Items with Full Details
  13. 13Orders with Payment and Shipping Status
  14. 14Customer Order Summary
  15. 15Products Never Reviewed
  16. 16Total Revenue per Product Category
  17. 17Products with Average Rating and Review Count
  18. 18Customers in the Same City
  19. 19Orders with Shipping Delays
  20. 20Delivered Orders Without Completed Payment
  21. 21Customer Order History with Names
  22. 22Order Line Items with Product Details
  23. 23Product Catalog with Category Names
  24. 24Orders with Shipping Status
  25. 25Detailed Review Report
  26. 26Customer Account List
  27. 27Customers with No Accounts
  28. 28Transaction Details with Customer Info
  29. 29Cards with Account Information
  30. 30Loan Payments with Customer Names
  31. 31Total Balance Per Customer
  32. 32Accounts with Card Count
  33. 33Customers in Branch Cities
  34. 34Customers with Both Checking and Savings
  35. 35Average Transaction Amount Per Customer
  36. 36Credit Card Utilization Rate
  37. 37Expired Cards with Customer Info
  38. 38Number of Cards Per Customer
  39. 39Customer First and Last Transaction Dates
  40. 40Customer Pairs in the Same City
  41. 41Customers with Active Loans but No Payments
  42. 42Customer Card Details Report
  43. 43Each Loan with Its Most Recent Payment
  44. 44Accounts That Have No Cards Issued
  45. 45Customer Total Balance with Branch Info
  46. 46Customer Transaction Summary
  47. 47Loan Payment Progress Tracker
  48. 48Average Balance by Branch City
  49. 49Customers Who Opened Accounts on the Same Day
  50. 50Visits with Patient Names
  51. 51Doctors with Department Names
  52. 52Patients with Insurance Details
  53. 53Visit Details with Prescriptions
  54. 54Visit Count per Doctor
  55. 55Billing Records with Patient Info
  56. 56Lab Results with Visit and Patient Info
  57. 57Revenue per Department
  58. 58Number of Unique Patients per Doctor
  59. 59Total Billing by Insurance Plan Type
  60. 60Overdue Bills with Patient Contact Info
  61. 61Number of Lab Tests per Visit
  62. 62Doctors with the Fewest Visits
  63. 63Doctor Pairs in the Same Department
  64. 64Patient Out-of-Pocket vs Insurance Coverage
  65. 65Complete Visit Detail Report
  66. 66Prescriptions with Patient, Doctor, and Diagnosis Details
  67. 67Patient Visit History with Doctor Details
  68. 68Average Prescriptions per Visit by Doctor
  69. 69Billing Breakdown by Insurance Plan Type
  70. 70Department Visit Completion Rate
  71. 71Patient Out-of-Pocket Exceeding Insurance Coverage
  72. 72Patients with Visits Within 30 Days of a Previous Visit
  73. 73Patients on Multiple Concurrent Medications
  74. 74Customers Who Reviewed Their Purchases
  75. 75Customers Who Live in a Branch City
See the full learning path →