Rolling Average of the Last Two Orders

medium
Unit 10 · Window Functions III0/2 to milestone

For each order, return customer_id, order_date, total and rolling_avg: the average of this order and the customer's previous order (just this one for their first order), rounded to 2 decimal places.

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
Rolling Average of the Last Two Orders · TechGradify