Yurttas/PL/DBL/mysql-f-2010/01/PC/q07.sql

From ZCubes Wiki
Revision as of 02:10, 4 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="sql" line start="1" enclose="div">/* REM REM q07.sql REM REM Find the manufacturer(s) of the computer(PC or laptop) REM with the highest available speed...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
 1/*
 2REM
 3REM q07.sql
 4REM
 5REM Find the manufacturer(s) of the computer(PC or laptop)
 6REM with the highest available speed.
 7REM
 8*/
 9
10\. set-db.sql
11
12CREATE VIEW ProdSpeed(model, speed)
13  AS (SELECT model, speed
14      FROM PC
15      WHERE speed IN (SELECT MAX(speed)
16                      FROM  PC))
17     UNION
18     (SELECT model, speed
19      FROM Laptop
20      WHERE speed IN (SELECT MAX(speed)
21                      FROM  Laptop));
22
23SELECT P.maker, S.speed
24FROM Product P, ProdSpeed S
25WHERE P.model=S.model
26  AND S.speed IN (SELECT MAX(speed)
27                  FROM ProdSpeed);