How many accounts have savings balances greater than the average savings balance?
select count(*) from savings where balance > (select avg(balance) from savings)
What are their names?
select t1.name from accounts as t1 join savings as t2 on t1.custid = t2.custid where t2.balance > (select avg(balance) from savings)
What are their checking account balances?
select t1.name, t2.balance from accounts as t1 join checking as t2 on t1.custid = t2.custid join savings as t3 on t1.custid = t3.custid where t3.balance > (select avg(balance) from savings)
How about both their total checking and savings balances.
select t1.name, t2.balance + t3.balance from accounts as t1 join checking as t2 on t1.custid = t2.custid join savings as t3 on t1.custid = t3.custid where t3.balance > (select avg(balance) from savings)