Yurttas/PL/DBL/postgres/F/01/Company-A/q05.sql

Revision as of 00:41, 5 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: SELECT current_schema();...")
(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
 9SELECT current_schema();
10SET search_path to "companya";
11
12SELECT DISTINCT E1.fname, E1.minit, E1.lname
13FROM Employee E1
14WHERE NOT EXISTS (SELECT pno
15                  FROM WorksOn
16                  WHERE pno NOT IN (SELECT pno
17                                    FROM Employee E2, WorksOn
18                                    WHERE essn = E2.ssn
19                                      AND E2.ssn = E1.ssn));