Customers With Above-Average Orders
Medium
Subqueries
Return the customers whose total spend is higher than the average total spend across all customers. Return customer_id and total_spent.
Table schema
Orders(id INT PRIMARY KEY, customer_id INT, amount INT)Sample data
id | customer_id | amount
1 | 1 | 100
2 | 1 | 100
3 | 2 | 50
4 | 3 | 30
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.