Write a SQL query to calculate monthly occupancy rate, average rent, and delinquency rate by property from lease and payment tables.
Use January through March 2024 and evaluate lease occupancy on the first day of each month. Treat a payment with a NULL paid date as delinquent.
Output
- One row per property and month, including properties with no active leases or payments
- Columns:
property_name, month, occupancy_rate_pct, average_rent, and delinquency_rate_pct
- Rates and rent must be rounded to two decimal places
- Order by
property_name, then month ascending