Write a SQL query using window functions to compute a 7-day rolling average of orders by city.
Use the orders table. Count only completed orders, exclude rows with a missing city, and treat dates without orders as zero-order days within each city's available date range.
city, order_date, daily_orders, and rolling_7_day_avgcity, then order_date| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| city | VARCHAR(100) | City where the order was placed |
| order_date | DATE | Date when the order was placed |
| status | VARCHAR(30) | Order lifecycle status |