Yurttas/PL/DBL/mysql/F/01/00/Company-B/q12.sql

Revision as of 16:18, 3 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="sql" line start="1" enclose="div">/* REM REM q12.sql REM REM Find those companies that pay more, on average, REM than the average salary at 'First Bank ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
 1/*
 2REM
 3REM q12.sql
 4REM
 5REM Find those companies that pay more, on average,
 6REM than the average salary at 'First Bank Corporation'.
 7REM
 8*/
 9
10\. set-db.sql
11
12SELECT companyname
13FROM Works
14GROUP BY companyname
15HAVING AVG(salary) > (SELECT AVG(salary)
16                      FROM Works
17                      WHERE companyname='First Bank Corporation');