What are the name, checking, and saving balances for all accounts?
select t2.balance, t3.balance, t1.name from accounts as t1 join checking as t2 on t1.custid = t2.custid join savings as t3 on t1.custid = t3.custid
Show me the total checking and savings balance of the accounts!
select t2.balance, t3.balance, t1.name, t3.balance + t2.balance from accounts as t1 join checking as t2 on t1.custid = t2.custid join savings as t3 on t1.custid = t3.custid
Show me only the accounts that have a lower savings balance than their checking balance?
select t2.balance, t3.balance, t1.name, t3.balance + 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 < t2.balance
Show just the name and total checking and savings balance.
select t1.name, t3.balance + 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 < t2.balance