Challenges/7-Day Rolling Revenue Average
Medium🗄️ sql

7-Day Rolling Revenue Average

Calculate the 7-day rolling average of daily revenue for each product. The `orders` table has columns: `date`, `product_id`, `revenue`. Return `date`, `product_id`, and `rolling_avg_revenue` rounded to 2 decimal places.

Examples

Example 1
Input: orders table with daily revenue by product
Output: date, product_id, rolling_avg_revenue
solution.py
1
2
3
4
5