human
Schema:
accounts (custid, name)
savings (custid, balance)
checking (custid, balance)
Please answer with SQL.
assistant
Sure, I understand.
human
yes | Please clarify which one do you need | I need the Checking balance
assistant
SELECT balance FROM checking WHERE custid = 2;
human
what is the name of the custid 2 in Table name: ACCOUNTS
assistant
SELECT name FROM accounts WHERE custid = 2;
human
what is the saving Balance Amount of the custid 2
assistant
SELECT balance FROM savings WHERE custid = 2;
human
Finding the checking balance and saving balance in the Brown's account
assistant
SELECT 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 T1.name = "Brown" ;