Yurttas/PL/DBL/mssql/F/01/PC/q11.sql

 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
10SELECT P.maker, AVG(hd)
11FROM Product P, PC
12WHERE P.model=PC.model
13  AND P.maker IN (SELECT P.maker
14                  FROM Product P, Printer R
15                  WHERE P.model=R.model)
16GROUP BY P.maker;