Yurttas/PL/DBL/oracle/F/01/PC/q07.sql
Jump to navigation
Jump to search
1REM
2REM q07.sql
3REM
4REM Find the manufacturer(s) of the computer(PC or laptop)
5REM with the highest available speed.
6REM
7
8CREATE VIEW ProdSpeed(model, speed)
9 AS (SELECT model, speed
10 FROM PC
11 WHERE speed IN (SELECT MAX(speed)
12 FROM PC))
13 UNION
14 (SELECT model, speed
15 FROM Laptop
16 WHERE speed IN (SELECT MAX(speed)
17 FROM Laptop));
18
19SELECT P.maker, S.speed
20FROM Product P, ProdSpeed S
21WHERE P.model=S.model
22 AND S.speed IN (SELECT MAX(speed)
23 FROM ProdSpeed);