Explain how you would write a SQL query to compute a rolling 3-day average using CTEs.
Use the daily_metrics table and treat missing calendar dates as having no metric value. The average should ignore NULL values.
metric_date, daily_active_users, and rolling_3_day_averagemetric_date ascending| Column | Type | Description |
|---|---|---|
| metric_idPK | INT | Unique metric record identifier |
| metric_date | DATE | Date on which the metric was recorded |
| active_users | INT | Number of active users recorded for the date |