Your question is SQL for Running Average. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
EXL Service uses an operations dashboard to monitor daily service performance. Write a PostgreSQL query that calculates a rolling average for the current date and the previous four calendar days.
| Column | Type | Description |
|---|---|---|
| calendar_datePK | DATE | Calendar date used to preserve dates without observations |
| Column | Type | Description |
|---|---|---|
| metric_idPK | INT | Unique service metric observation identifier |
| metric_date | DATE | Date on which the observation was recorded |
| metric_name | VARCHAR(50) | Name of the monitored service metric |
| metric_value | DECIMAL(10,2) | Observed metric value |