Chapter 5 · JOINs
06. Total Interest Paid by Loan Type
Easy10 XPFinance
The finance department wants to know how much interest has been collected for each loan type. Return loan_type and total_interest (sum of interest_paid from payments). Sort by total_interest descending.
Tables
- PKidINT
- FKcustomer_id→ customers.idINT
- loan_typeTEXT
- principalREAL
- interest_rateREAL
- term_monthsINT
- start_dateTEXT
- statusTEXT
- PKidINT
- FKloan_id→ loans.idINT
- payment_dateTEXT
- amountREAL
- principal_paidREAL
- interest_paidREAL
- remaining_balanceREAL
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.