Yurttas/PL/DBL/mysql-f-2010/01/Company-A/q05.sql

Revision as of 01:59, 4 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="sql" line start="1" enclose="div">β†’β€ŽREM REM q05.sql REM REM Retrieve the names of employees who work on every project. REM: \. set-db.sql SELECT DI...")
(diff) ← Older revision | Latest revision (diff) | Newer revision β†’ (diff)
 1/*
 2REM
 3REM q05.sql
 4REM
 5REM Retrieve the names of employees who work on every project.
 6REM
 7*/
 8
 9\. set-db.sql
10
11SELECT DISTINCT E1.fname, E1.minit, E1.lname
12FROM Employee E1
13WHERE NOT EXISTS (SELECT pno
14                  FROM WorksOn
15                  WHERE pno NOT IN (SELECT pno
16                                    FROM Employee E2, WorksOn
17                                    WHERE essn = E2.ssn
18                                      AND E2.ssn = E1.ssn));