easy · ~8 min
Finance wants to identify high-spend customers from the orders table whose combined order spending strictly exceeds 500.
orders
Write a query that reports qualifying customers and their total spend:
total_amount
500
customer_id
Input contract: order_id is unique and non-null; customer_id and amount are non-null (amount > 0). A customer may place one or many orders of any size.
order_id
amount
amount > 0