human
Schema:
accounts (custid, name)
savings (custid, balance)
checking (custid, balance)
Please answer with SQL.
assistant
Sure, I understand.
human
What is the average savings balance?
assistant
SELECT AVG ( balance ) FROM savings;
human
How many people have savings account balances over it?
assistant
SELECT COUNT( * ) FROM savings WHERE balance > ( SELECT AVG ( balance ) FROM savings ) ;