Yurttas/PL/DBL/postgres/F/01/PC/q11.sql
Jump to navigation
Jump to search
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 current_schema();
11SET search_path to "pc";
12
13SELECT P.maker, AVG(hd)
14FROM Product P, PC
15WHERE P.model=PC.model
16 AND P.maker IN (SELECT P.maker
17 FROM Product P, Printer R
18 WHERE P.model=R.model)
19GROUP BY P.maker;