Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Product (maker, model, type)
- PC (model, speed, ram , hd, screen, price)
- Laptop ( model, speed, ram, hd, screen, price)
- Printer (model, color, type ,price)
- with model being the key for everything.
- Find those manufacturers that sell Laptops but not PC's
- SELECT maker
- FROM Product p1
- WHERE EXISTS( SELECT *
- FROM Product
- WHERE type = p1.type AND type = 'laptop')
- AND
- NOT EXISTS( SELECT *
- FROM Product
- WHERE type = p1.type AND type = 'pc');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement