Yurttas/PL/DBL/postgres/F/01/Bank/a03.sql

Revision as of 00:37, 5 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="sql" line start="1" enclose="div">/* REM REM a03.sql REM REM Find the average account balance at each branch REM where the average account balance is mo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
 1/*
 2REM
 3REM a03.sql
 4REM
 5REM Find the average account balance at each branch
 6REM where the average account balance is more than $400.
 7REM
 8*/
 9
10SELECT current_schema();
11SET search_path to "bank";
12
13SELECT branchname, AVG(balance)
14FROM Depositor
15GROUP BY branchname
16HAVING AVG(balance)>400;