Yurttas/PL/DBL/oracle/F/01/Company-B/q11.sql

From ZCubes Wiki
Revision as of 22:56, 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 SELECT companyname FROM Works GROUP BY com...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
 1REM
 2REM q11.sql
 3REM
 4REM Find the company with the smallest payroll.
 5REM
 6
 7SELECT companyname 
 8FROM Works 
 9GROUP BY companyname 
10HAVING SUM(salary) <= ALL (SELECT SUM(salary) 
11                           FROM Works 
12                           GROUP BY companyname);