Write a SQL query to calculate the rolling average of flight delays by airport over a seven-day window.
Use the flight_delays table. Calculate the average across flights with non-null delay values, including the current date and preceding six calendar days.
airport_code, flight_date, and rolling_avg_delay.airport_code, then flight_date.| Column | Type | Description |
|---|---|---|
| flight_idPK | INT | Unique flight identifier |
| airport_code | VARCHAR(3) | Three-letter airport code |
| flight_date | DATE | Date of the flight |
| delay_minutes | INT | Arrival delay in minutes, where negative values indicate an early arrival |