I want to know what is the greatest amount of loan to customers that each bank branch has made.
select t2.bname, max ( t1.amount ) from loan as t1 join bank as t2 on t1.branch_id = t2.branch_id join customer as t3 on t1.cust_id = t3.cust_id group by t2.bname
Can you show me the credit score of the customer receiving the greatest amount of loan?
select t2.credit_score from loan as t1 join customer as t2 on t1.cust_id = t2.cust_id order by t1.amount desc limit 1
Can you show me the name of the bank branch providing the greatest total amount of loans to customers?
select t2.bname from loan as t1 join bank as t2 on t1.branch_id = t2.branch_id join customer as t3 on t1.cust_id = t3.cust_id group by t2.bname order by sum ( t1.amount ) desc limit 1