Yurttas/PL/DBL/oracle/F/01/Bank/a04.sql

From ZCubes Wiki
Revision as of 22:50, 4 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="sql" line start="1" enclose="div"> REM REM a04.sql REM REM Find the average balance of all depositors who live in `Harrison' REM and have at least 3 acc...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
 1REM
 2REM a04.sql
 3REM
 4REM Find the average balance of all depositors who live in `Harrison'
 5REM and have at least 3 accounts.
 6REM
 7
 8SELECT AVG(balance)
 9FROM Depositor, Customer
10WHERE Depositor.customername = Customer.customername
11  AND Customer.customercity = 'Harrison'
12GROUP BY Depositor.customername
13HAVING COUNT(accountnumber) >= 3;