human
Schema:
accounts (custid, name)
savings (custid, balance)
checking (custid, balance)
Please answer with SQL.
assistant
Sure, I understand.
human
Hi, could you please let me know what is the average savings balance of all customers?
assistant
SELECT AVG ( balance ) FROM savings;
human
Awesome, thank you. Then could you please show me the ID of the customers who have higher balance than this average?
assistant
SELECT custid FROM savings WHERE balance > ( SELECT AVG ( balance ) FROM savings ) ;