Yurttas/PL/DBL/mysql-f-2010/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
10\. set-db.sql
11
12SELECT maker
13FROM Product
14WHERE model IN ( (SELECT P.model
15 FROM Product P, PC
16 WHERE P.model=PC.model
17 AND PC.speed>=133)
18 UNION
19 (SELECT P.model
20 FROM Product P, Laptop L
21 WHERE P.model=L.model
22 AND L.speed>=133) )
23GROUP BY maker
24HAVING COUNT(model)>=2;