Chapter 6 · Subqueries
20. Loans Above Their Type Average
Medium20 XPFinance
The analytics team wants to find loans whose principal exceeds the average principal for their specific loan type. Return the loan id, loan_type, principal, and interest_rate. Sort by 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.