Yurttas/PL/DBL/mysql/F/01/00/SPJ/q14.sql

Revision as of 16:36, 3 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="sql" line start="1" enclose="div">/* REM REM q14.sql REM REM Construct a table containing a list of project numbers REM for projects that are either loc...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
 1/*
 2REM
 3REM q14.sql
 4REM
 5REM Construct a table containing a list of project numbers
 6REM for projects that are either located in 'London' or are
 7REM supplied by a 'London' supplier.
 8REM
 9*/
10
11\. set-db.sql
12
13CREATE TABLE LondonProjs (JN VARCHAR(4));
14    
15INSERT INTO LondonProjs
16(SELECT T.JN
17 FROM Shipments T, Suppliers S
18 WHERE T.SN = S.SN
19   AND S.CITY = 'London')
20UNION
21(SELECT JN
22 FROM Projects
23 WHERE CITY = 'London');