-- Database schema
| ACCOUNTS : custid [ INT ] primary_key , name [ TEXT ] | SAVINGS : custid [ INT ] primary_key SAVINGS.custid = ACCOUNTS.custid , balance [ INT ] | CHECKING : custid [ INT ] primary_key CHECKING.custid = ACCOUNTS.custid , balance [ INT ] |
-- -- Find the number of accounts with a savings balance that is higher than the average savings balance.

SELECT count(*) FROM savings WHERE balance  >  (SELECT avg(balance) FROM savings);