what is the average amount of all loans?
select avg(amount) from loan
how about the total amount?
select sum(amount) from loan
Find the names of customer who have loans.
select distinct t1.cust_name from customer as t1 join loan as t2 on t1.cust_id = t2.cust_id
who has the largest amount of loans?
select t1.cust_name from customer as t1 join loan as t2 on t1.cust_id = t2.cust_id group by t1.cust_name order by sum(t2.amount) desc limit 1