Skip to main content
All Problems
hard0% acceptance

7-Day Moving Average of Order Amounts

Compute a 7-day moving average of daily order revenue. For each date, show the order_date, daily revenue, and the average of the current day plus the 6 preceding days. Round to 2 decimal places. Sort by order_date.

Schema

🔑idINT
🔗customer_idINT
order_dateTEXT
statusTEXT
total_amountREAL
postgresql

Run your query to see results

Press Ctrl + Enter to execute