Juniper Networks uses daily telemetry from Juniper Mist and Junos devices to monitor network demand. Write a PostgreSQL query that calculates a seven-day rolling average of daily traffic and compares it with the immediately preceding seven-day period.
traffic_date, daily_traffic_gb, current_7_day_avg_gb, previous_7_day_avg_gb, change_gb, and change_percent.change_gb as the signed current average minus the previous average, not as an absolute value.change_percent as NULL when the previous seven-day total is zero.| Column | Type | Description |
|---|---|---|
| traffic_idPK | INT | Unique telemetry record identifier |
| traffic_date | DATE | Date of the traffic measurement |
| device_group | VARCHAR(40) | Juniper device group or product family |
| traffic_gb | NUMERIC(10,2) | Traffic volume in gigabytes |