Write a window function to calculate the month-over-month rent growth for our portfolio across different zip codes.
Use the properties and rent_observations tables. Calculate each ZIP code's average monthly rent and its percentage change from the previous reported month. Exclude the first month for each ZIP code because it has no prior comparison.
zip_code, month_start, average_rent, and rent_growth_pctzip_code, then month_start ascending| Column | Type | Description |
|---|---|---|
| property_idPK | INT | Unique property identifier |
| property_name | VARCHAR(100) | Property name |
| zip_code | VARCHAR(5) | Property ZIP code |
| Column | Type | Description |
|---|---|---|
| observation_idPK | INT | Unique rent observation identifier |
| property_id | INT | Property associated with the observation |
| observed_on | DATE | Date of the rent observation |
| monthly_rent | NUMERIC(10,2) | Observed monthly rent amount |