Yurttas/PL/DBL/mysql-f-2010/01/Company-B/q11.sql

From ZCubes Wiki
Revision as of 02:01, 4 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="sql" line start="1" enclose="div">→‎REM REM q11.sql REM REM Find the company with the smallest payroll. REM: \. set-db.sql SELECT companyname FROM ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
 1/*
 2REM
 3REM q11.sql
 4REM
 5REM Find the company with the smallest payroll.
 6REM
 7*/
 8
 9\. set-db.sql
10
11SELECT companyname
12FROM Works
13GROUP BY companyname
14HAVING SUM(salary) <= ALL (SELECT SUM(salary)
15                           FROM Works
16                           GROUP BY companyname);