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

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 q11.sql REM REM Find the average hard disk size of a PC for all those REM manufacturers that make printers....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
 1/*
 2REM
 3REM q11.sql
 4REM
 5REM Find the average hard disk size of a PC for all those
 6REM manufacturers that make printers.
 7REM
 8*/
 9
10\. set-db.sql
11
12SELECT P.maker, AVG(hd)
13FROM Product P, PC
14WHERE P.model=PC.model
15  AND P.maker IN (SELECT P.maker
16                  FROM Product P, Printer R
17                  WHERE P.model=R.model)
18GROUP BY P.maker;