Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. Product (maker, model, type)
  2. PC (model, speed, ram , hd, screen, price)
  3. Laptop ( model, speed, ram, hd, screen, price)
  4. Printer (model, color, type ,price)
  5.  
  6. with model being the key for everything.
  7. Find those manufacturers that sell Laptops but not PC's
  8.  
  9. SELECT maker
  10. FROM Product p1
  11. WHERE EXISTS( SELECT *
  12. FROM Product
  13. WHERE type = p1.type AND type = 'laptop')
  14. AND
  15. NOT EXISTS( SELECT *
  16. FROM Product
  17. WHERE type = p1.type AND type = 'pc');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement