Yurttas/PL/DBL/postgres/F/01/PC/q03.sql
Jump to navigation
Jump to search
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);