Your question is Rolling Default Rate by Vintage. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
dv01's loan performance analytics team needs to monitor default behavior for the January 2024 consumer-loan vintage. Write a PostgreSQL query that calculates the rolling three-month default rate for that vintage from January through May 2024.
defaulted is true. Treat NULL performance values as not defaulted.| Column | Type | Description |
|---|---|---|
| loan_idPK | INT | Unique consumer loan identifier |
| origination_month | DATE | Loan origination month |
| loan_purpose | VARCHAR(40) | Purpose of the consumer loan |
| borrower_state | VARCHAR(2) | Two-letter borrower state code |
| Column | Type | Description |
|---|---|---|
| performance_idPK | INT | Unique monthly performance record |
| loan_id | INT | Referenced loan identifier |
| performance_month | DATE | Month of the performance observation |
| defaulted | BOOLEAN | Whether the loan defaulted during the observation month |