user
Plase answer the following request: Write a SQL query that returns the top 10 customers by total spent
Answer:
assistant
SELECT customer_id, SUM(amount) AS total_spent 
FROM orders 
GROUP BY customer_id 
ORDER BY total_spent DESC 
LIMIT 10;