human
Schema:
accounts (custid, name)
savings (custid, balance)
checking (custid, balance)
Please answer with SQL.
assistant
Sure, I understand.
human
I need to know the number of checking accounts for each account name.
assistant
SELECT COUNT( * ) , T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid GROUP BY T1.name;
human
What is the highest account balance of customers with checking accounts?
assistant
SELECT MAX( balance ) FROM checking ;