Top Spending Customer Per Product Category

Hard
joins Amazon Netflix Spotify

For each product category, find the customer who spent the most in total. Use a join with aggregation and a subquery to rank within categories.

Expected Output

category customer_name total_spent
Books Bob 120.0
Electronics Alice 300.0

Tables

Hints (3 available)

SQL Editor

Output

Click "Run" to see results...