Write a SQL query to compare month-over-month changes in utilization rate by location and rank the locations by improvement.
Use the provided Hertz location and utilization data. Calculate utilization as total utilized hours divided by total available hours for each location and month, then compare each month with the preceding month.
location_name, month_start, utilization_rate, prior_utilization_rate, utilization_change, and improvement_rank.month_start, improvement_rank, and location_name.| Column | Type | Description |
|---|---|---|
| location_idPK | INT | Unique Hertz rental location identifier |
| location_code | VARCHAR(10) | Short operational code for the location |
| location_name | VARCHAR(100) | Display name of the Hertz location |
| region | VARCHAR(50) | Operating region for the location |
| Column | Type | Description |
|---|---|---|
| utilization_idPK | INT | Unique utilization record identifier |
| location_id | INT | Hertz location associated with the record |
| utilization_date | DATE | Date represented by the utilization record |
| utilized_hours | NUMERIC(10,2) | Hours vehicles were actively utilized |
| available_hours | NUMERIC(10,2) | Hours vehicles were available for utilization |