#269

Restaurant Revenue Over Time

Restaurant management tracks revenue trends via rolling averages. For each day starting from the restaurant's 7th day of operation, compute the total customer spending over a 7-day window (current day + 6 previous) and the daily average. Output visited_on, amount, and average_amount — round the average to 2 decimal places.

Expected output sample

This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.

amountvisited_onaverage_amount
1802024-01-07180.00
4002024-01-08200.00
5602024-01-09186.67

Your query result will appear here