Frequency and Monetary Value
Return each customer's number of orders (frequency) and total spend (monetary), ordered by monetary descending.
Table schema
Orders(id INT PRIMARY KEY, customer VARCHAR(10), order_date DATE, amount INT)Sample data
id | customer | order_date | amount
1 | Ann | 2026-06-20 | 200
2 | Ann | 2026-06-01 | 150
3 | Bob | 2026-05-01 | 90
4 | Cy | 2026-06-28 | 120
5 | Cy | 2026-06-10 | 60
6 | Cy | 2026-04-01 | 40
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.