Customer Spend Change Month over Month

medium
Unit 16 · Window Functions IX0/2 to milestone

Compute each customer's spend per month in which they ordered. Return customer_id, month (YYYY-MM), spend and change: the difference from their previous ordering month's spend (NULL for their first). Sort by customer_id, then 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
Customer Spend Change Month over Month · TechGradify