How comfortable are you with SQL and Python?
Demonstrate your SQL experience by writing a query against the provided loans and loan_payments tables. Include only active loans with at least two completed payments during 2025.
loan_id, borrower_name, completed_payment_count, total_completed_paid, latest_payment_date, and payment_statuspayment_status to current when the latest payment date is on or after 2025-06-01, otherwise needs_reviewtotal_completed_paid descending, then loan_id ascending| Column | Type | Description |
|---|---|---|
| loan_idPK | INT | Unique loan identifier |
| borrower_name | VARCHAR(100) | Borrower name |
| status | VARCHAR(20) | Current loan status |
| origination_date | DATE | Date the loan was originated |
| Column | Type | Description |
|---|---|---|
| payment_idPK | INT | Unique payment identifier |
| loan_id | INT | Loan associated with the payment |
| payment_date | DATE | Date of payment activity |
| amount | NUMERIC(10,2) | Payment amount |
| payment_status | VARCHAR(20) | Payment processing status |