Yurttas/PL/DBL/postgres/F/01/PC/q03.sql

Revision as of 23:48, 4 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="sql" line start="1" enclose="div">/* REM REM q03.sql REM REM Find the model number and price of all products REM (of any type) made by manufacturer 'B'....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
 1/*
 2REM
 3REM q03.sql
 4REM
 5REM Find the model number and price of all products
 6REM (of any type) made by manufacturer 'B'.
 7REM
 8*/
 9
10SELECT current_schema();
11SET search_path to "pc";
12
13(SELECT PC.model, price
14 FROM Product P, PC
15 WHERE maker='B'
16   AND P.model=PC.model )
17UNION
18(SELECT L.model, L.price
19 FROM Product P, Laptop L
20 WHERE maker='B'
21   AND P.model=L.model)
22UNION
23(SELECT R.model, R.price
24 FROM Product P, Printer R
25 WHERE P.maker='B'
26   AND P.model=R.model);