Can you show me the names and total checking and savings account 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
I want to know the average savings balance of all accounts.
select avg ( balance ) from savings
Hmm, can you list the names of customers whose savings account balances are higher than the average savings balance?
select t1.name from accounts as t1 join savings as t2 on t1.custid = t2.custid where t2.balance > ( select avg ( balance ) from savings )