Top Customer Each Month

hard
Unit 23 · Window Functions 110/0 to milestone

For each month (YYYY-MM, from order_date) return month, the name of the customer with the highest total spend that month, and their spend. Sort by month.

Pro problem

Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.

Start 7-day free trial
query.sql · SQLite
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Top Customer Each Month · TechGradify