human
Schema:
accounts (custid, name)
savings (custid, balance)
checking (custid, balance)
Please answer with SQL.
assistant
Sure, I understand.
human
how many accounts have a savings balance above the average savings balance?
assistant
SELECT COUNT( * ) FROM savings WHERE balance > ( SELECT AVG ( balance ) FROM savings ) ;