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

Revision as of 04:31, 3 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 B...")
(diff) ← Older revision | Latest revision (diff) | Newer revision β†’ (diff)
 1/*
 2REM
 3REM q11.sql
 4REM
 5REM Find the company with the smallest payroll.
 6REM
 7*/
 8
 9SELECT companyname 
10FROM Works 
11GROUP BY companyname 
12HAVING SUM(salary) <= ALL (SELECT SUM(salary) 
13                           FROM Works 
14                           GROUP BY companyname);