Yurttas/PL/DBL/mssql/F/01/PC/q06.sql
Jump to navigation
Jump to search
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 maker
11FROM Product
12WHERE model IN ( (SELECT P.model
13 FROM Product P, PC
14 WHERE P.model=PC.model
15 AND PC.speed>=133)
16 UNION
17 (SELECT P.model
18 FROM Product P, Laptop L
19 WHERE P.model=L.model
20 AND L.speed>=133) )
21GROUP BY maker
22HAVING COUNT(model)>=2;