Write a query using SQL window functions to calculate the rolling three-month average of desk utilization.
Calculate utilization as desks used divided by desks available, expressed as a percentage. Treat a zero capacity as undefined and allow missing utilization values to be ignored by the average.
location_name, month_start, utilization_rate, and rolling_three_month_avg.location_name, then month_start.| Column | Type | Description |
|---|---|---|
| location_idPK | INT | Unique identifier for a coworking location |
| location_name | VARCHAR(100) | Name of the coworking location |
| Column | Type | Description |
|---|---|---|
| utilization_idPK | INT | Unique monthly utilization record identifier |
| location_id | INT | Location associated with the utilization record |
| month_start | DATE | First day of the utilization month |
| desks_available | INT | Number of desks available during the month |
| desks_used | INT | Number of desks used during the month |