Yurttas/PL/DBL/postgres/F/01/Company-A/q01.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 q01.sql REM REM Retrieve the names of employees in department 5 REM who work more than 10 hours per week on...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
 1/*
 2REM
 3REM q01.sql
 4REM
 5REM Retrieve the names of employees in department 5
 6REM who work more than 10 hours per week on the
 7REM 'ProductX' project.
 8REM
 9*/
10
11SELECT current_schema();
12SET search_path to "companya";
13
14SELECT DISTINCT fname, minit, lname
15FROM Employee, Project, WorksOn
16WHERE Employee.dno = Project.dnum
17  AND Employee.ssn = WorksOn.essn
18  AND Project.pnumber = WorksOn.pno
19  AND Employee.dno = 5
20  AND hours > 10
21  AND pname = 'ProductX';