Chapter 4 · Aggregations
23. Loan Portfolio Status Summary
Easy10 XPFinance
The executive team needs a quick overview of the loan portfolio. For each loan status (active, paid, defaulted), return the status, the count of loans, the total principal, and the average interest rate rounded to 2 decimals. Sort by total_principal descending.
Tables
- PKidINT
- FKcustomer_id→ customers.idINT
- loan_typeTEXT
- principalREAL
- interest_rateREAL
- term_monthsINT
- start_dateTEXT
- statusTEXT
Need help?
Ask Sol
AI tutor — looks at your current query and nudges you, without spoiling the answer.
Solution
Try the hints first — solving it yourself is what makes it stick.