Revenue per Customer (Completed Orders) | Algorithm
MediumaggregationSQL
Revenue per Customer (Completed Orders)
For each customer that has at least one completed order, return the customer name and their total revenue (sum of quantity × unit_price across completed orders). Cancelled and pending orders do not count.
Expected output
name
revenue
3 rows — values hidden, that's the puzzle
Your query should return 3 rows with these columns. Your column aliases don't need to match.