Yurttas/PL/DBL/postgres/F/01/PC/q06.sql
1/*
2REM
3REM q06.sql
4REM
5REM Find those manufacturers of at least two different
6REM computers (PC's or laptops) with speeds of at least 133.
7REM
8*/
9
10SELECT current_schema();
11SET search_path to "pc";
12
13SELECT maker
14FROM Product
15WHERE model IN ( (SELECT P.model
16 FROM Product P, PC
17 WHERE P.model=PC.model
18 AND PC.speed>=133)
19 UNION
20 (SELECT P.model
21 FROM Product P, Laptop L
22 WHERE P.model=L.model
23 AND L.speed>=133) )
24GROUP BY maker
25HAVING COUNT(model)>=2;