Top Customer by Total Spend
Easy
Derived Tables
Using a derived table of customer totals, return the customer with the highest total spend.
Table schema
Orders(id INT PRIMARY KEY, customer VARCHAR(10), amount INT)Sample data
id | customer | amount
1 | Ann | 100
2 | Bob | 250
3 | Ann | 200
4 | Cy | 120
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.