How would you implement a SQL window function to analyze trends over time?
Use the provided metric catalog and observations to calculate daily metric values and their cumulative values over time.
metric_name, metric_date, daily_value, and cumulative_value.metric_name, then metric_date ascending.| Column | Type | Description |
|---|---|---|
| metric_idPK | INT | Unique metric identifier |
| metric_name | VARCHAR(100) | Readable metric name |
| Column | Type | Description |
|---|---|---|
| observation_idPK | INT | Unique observation identifier |
| metric_id | INT | Referenced metric identifier |
| metric_date | DATE | Date of the observation |
| metric_value | DECIMAL(12,2) | Observed metric value |