← SQL Playground
Spend Per Customer
MediumPremiumReturn each customer's
name and their total order amount as total_spent. Include only customers who have placed at least one order. Order by total_spent descending, then name ascending.Schema
customers (id, name, city)
orders (id, customer_id, amount, order_date)
Loading editor…
Hints