Chapter 4 · Aggregations
04. Orders Per Customer
Easy10 XPE-Commerce
The customer success team wants to identify engagement levels. For each customer, count the number of orders they have placed. Return customer_id and order_count, sorted by order_count descending.
Tables
- PKidINT
- FKcustomer_id→ customers.idINT
- order_dateTEXT
- statusTEXT
- total_amountREAL
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.