71
Complex Correlated Query
•Product ( pname,  price, category, maker, year)
•Find products (and their manufacturers) that are more expensive than all products made by the same manufacturer before 1972
•
•
•
•
•
•
•
•Powerful, but much harder to optimize !
SELECT DISTINCT  pname, maker
FROM     Product AS x
WHERE  price > ALL  (SELECT  price
                                        FROM    Product AS y
                                        WHERE  x.maker = y.maker AND y.year < 1972);