human
Schema:
accounts (custid, name)
savings (custid, balance)
checking (custid, balance)
Please answer with SQL.
assistant
Sure, I understand.
human
Can you show me the number of customers?
assistant
SELECT COUNT( distinct custid ) FROM accounts;
human
how about the number of checking accounts?
assistant
SELECT COUNT( * ) FROM checking;
human
what's the lowest balance of a savings account?
assistant
SELECT MIN( balance ) FROM savings;
human
who owns that account?
assistant
SELECT T2.custid FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T2.balance LIMIT 1 ;