The database schema consists of four tables:
Product(maker, model, type) PC(code, model, speed, ram, hd, cd, price) Laptop(code, model, speed, ram, hd, price, screen) Printer(code, model, color, type, price)
Task: Find manufacturers of the cheapest color printers. Print: maker, price
Wrong:
SELECT DISTINCT maker, price FROM printer, product WHERE printer.model = product.model AND (color = 'y') AND price <= ALL (SELECT price FROM printer WHERE color = 'y')
Right:
SELECT DISTINCT maker, price FROM printer, product WHERE printer.model = product.model AND color = 'y' AND price = (SELECT MIN(price) FROM printer WHERE color = 'y')