Find the name of account that has the lowest total checking and saving balance.
select t1.name from accounts as t1 join checking as t2 on t1.custid = t2.custid join savings as t3 on t1.custid = t3.custid order by t2.balance + t3.balance limit 1
Ok!. Can you please give me the names of the accounts where the checking balance is more than 3000
select t1.name from accounts as t1 join checking as t2 on t1.custid = t2.custid join savings as t3 on t1.custid = t3.custid where t2.balance>3000
Give me the names of the accounts where the savings balance is more than 20000
select t1.name 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>20000
What is the highest balance in the savings account?
select balance from savings order by balance desc limit 1
Hmmm. Please tell me what is the lowest balance in the savings account.
select min ( balance ) from savings
Can you also give me the lowest and the highest balance for checking account.
select max ( balance ) ,min ( balance ) from checking