DoorDash analysts smooth noisy daily order volume with a trailing 3-day moving average. For a given day, the moving average is the mean of `orders_count` for that day and the two preceding days. Write an SQL query that returns `order_day`, `orders_count` and `moving_avg_3d` (rounded to 2 decimal places). Only include days that have a full 3-day window (so the first two days are excluded). Order the results by `order_day` ascending.
Loading…
Try solving the question with the schema explorer and hints first. When ready, reveal the verified canonical query and step-by-step logic breakdown.
Ask questions, share alternate queries, and explore solutions
Your recent query executions and answer checks
This will insert the verified MySQL solution into your editor so you can study how each clause transforms the table.