Write a query using window functions to calculate the moving average of monthly loan defaults.
Use the calendar table so months with no defaults appear with a count of zero. Calculate a three-month moving average that includes the current month and up to the two preceding calendar months.
Output
- One row per calendar month with
month_start, monthly_defaults, and three_month_moving_average.
- Include all calendar months, order by
month_start ascending, and round the moving average to two decimal places.