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

From ZCubes Wiki
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 q09.sql REM REM Find the names and the addresses of employees who work REM on at least one project located ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
 1/*
 2REM
 3REM q09.sql
 4REM
 5REM Find the names and the addresses of employees who work
 6REM on at least one project located in 'Houston' but whose
 7REM department has no location in 'Houston'.
 8REM
 9*/
10
11SELECT current_schema();
12SET search_path to "companya";
13
14SELECT DISTINCT fname, lname, address, dno
15FROM Employee, WorksOn, Project, DeptLocation
16WHERE ssn = essn
17  AND pno = pnumber
18  AND plocation = 'Houston'
19  AND dno = dnumber
20  AND dlocation <> 'Houston';