Your question is Top-Decile Risk Segments SQL. 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.
American Credit Acceptance wants to monitor delinquency patterns across its auto loan portfolio. Using posted payment transactions from 2025, write a PostgreSQL query to identify the top-decile risk segment, where a segment is defined by borrower state and risk tier.
LATE and CHARGED_OFF as delinquent.| Column | Type | Description |
|---|---|---|
| loan_idPK | INTEGER | Unique auto loan identifier |
| state | VARCHAR(2) | Borrower state |
| risk_tier | VARCHAR(30) | Underwriting risk classification |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INTEGER | Unique payment transaction identifier |
| loan_id | INTEGER | Loan associated with the payment transaction |
| transaction_date | DATE | Date the payment transaction was posted |
| status | VARCHAR(20) | Payment outcome status |