human
Schema:
accounts (custid, name)
savings (custid, balance)
checking (custid, balance)
Please answer with SQL.
assistant
Sure, I understand.
human
FIND THE all CHECKING BALANCE OF ALL ACCOUNTS
assistant
SELECT balance FROM checking;
human
FIND THE SAVING BALANCE OF ALL ACCOUNTS
assistant
SELECT balance FROM savings;
human
SORT ALL THE TOTAL BALANCE OF CHECKING AND SAVING ACCOUNT IN ASCENDING ORDER
assistant
SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T1.balance + T2.balance ;