SQL practice › Joins & grouping
Total Spend per Customer
Medium · Joins & grouping
For every customer who has at least one order that is not cancelled, return the customer name and the total amount they spent on non-cancelled orders (quantity × price).
Hint
Join four tables: customers → orders → order_items → products.
Write your query on this page — it runs against the sample company database in your browser and is checked instantly.
Next problem: Above Their Department Average