2019-11-05

Nov 6 In-Class Exercise Thread.

Post your solutions to the Nov 6 In-Class Exercise to this thread.
Best, Chris
Post your solutions to the Nov 6 In-Class Exercise to this thread. Best, Chris
2019-11-06

-- Nov 6 In-Class Exercise Thread
1.) Select P. maker, L.price, L.model from Laptop L , Product P where L.Ram> 16 AND P.model = L.model AND P.type= Laptop
2.)(Select maker,model from Product, Printer where Product.model = Printer.model AND Type=Printer) Except (Select maker, model from Product, PC where Product.model = PC.Model AND PC.price<800 AND type=PC)
(Edited: 2019-11-06)
1.) Select P. maker, L.price, L.model from Laptop L , Product P where L.Ram> 16 AND P.model = L.model AND P.type= Laptop 2.)(Select maker,model from Product, Printer where Product.model = Printer.model AND Type=Printer) Except (Select maker, model from Product, PC where Product.model = PC.Model AND PC.price<800 AND type=PC)

-- Nov 6 In-Class Exercise Thread
 1) SELECT maker as manufacturer, Laptop.price, Laptop.model 
 FROM product, laptop
 WHERE ram > 16 AND laptop.model = product.model AND type = 'laptop';
 
 2) SELECT maker as manufacturer
 FROM product, printer
 WHERE product.model = printer.model AND product.type = 'printer'
 EXCEPT
 SELECT maker as manufacturer
 WHERE product.type = 'pc' AND product.model = pc.model AND pc.price < 800;
(Edited: 2019-11-06)
1) SELECT maker as manufacturer, Laptop.price, Laptop.model FROM product, laptop WHERE ram > 16 AND laptop.model = product.model AND type = 'laptop'; 2) SELECT maker as manufacturer FROM product, printer WHERE product.model = printer.model AND product.type = 'printer' EXCEPT SELECT maker as manufacturer WHERE product.type = 'pc' AND product.model = pc.model AND pc.price < 800;

-- Nov 6 In-Class Exercise Thread
Assuming that the manufacturers have different formats for model numbers of PCs, Laptops, and Printers
 
The manufacturer, price, and model of laptops which have more than 16GB of ram.
  SELECT maker AS "manufacturer", price, model
  FROM Product, Laptop
  WHERE Product.model = Laptop.model AND Laptop.ram > 16
 
The manufacturers of printers that do not sell PCs under $800.
  (SELECT maker AS "manufacturer" 
  FROM Product, Printer
  WHERE Product.model = Printer.model)
  EXCEPT 
  (SELECT maker AS "manufacturer"
  FROM Product, PC
  WHERE Product.model = PC.model AND PC.price < 800); 
(Edited: 2019-11-06)
Assuming that the manufacturers have different formats for model numbers of PCs, Laptops, and Printers The manufacturer, price, and model of laptops which have more than 16GB of ram. SELECT maker AS "manufacturer", price, model FROM Product, Laptop WHERE Product.model = Laptop.model AND Laptop.ram > 16 The manufacturers of printers that do not sell PCs under $800. (SELECT maker AS "manufacturer" FROM Product, Printer WHERE Product.model = Printer.model) EXCEPT (SELECT maker AS "manufacturer" FROM Product, PC WHERE Product.model = PC.model AND PC.price < 800);

-- Nov 6 In-Class Exercise Thread
1.) SELECT P. maker, L.price, L.model FROM Laptop L , Product P WHERE L.Ram> 16
2.)SELECT Product.maker AS manufacturer FROM Product, PC, Printer WHERE Product.type = 'Printer' AND PC.price > 800.
(Edited: 2019-11-06)
1.) SELECT P. maker, L.price, L.model FROM Laptop L , Product P WHERE L.Ram> 16 2.)SELECT Product.maker AS manufacturer FROM Product, PC, Printer WHERE Product.type = 'Printer' AND PC.price > 800.

-- Nov 6 In-Class Exercise Thread
1.)
 SELECT maker AS manufacturer, price, model
 FROM Laptop, Product
 WHERE Laptop.model = Product.model AND ram > 16Gb;
2.)
 SELECT maker AS manufacturer
 FROM Printer p1, PC p2, Product
 WHERE Product.model = p1.model AND Product.model = p2.model AND p2.price >= 800;
 
(Edited: 2019-11-06)
1.) SELECT maker AS manufacturer, price, model FROM Laptop, Product WHERE Laptop.model = Product.model AND ram > 16Gb; 2.) SELECT maker AS manufacturer FROM Printer p1, PC p2, Product WHERE Product.model = p1.model AND Product.model = p2.model AND p2.price >= 800;

-- Nov 6 In-Class Exercise Thread
1.
 SELECT Product.maker AS manufacturer, Laptop.price, Laptop.model
 FROM Product,Laptop
 WHERE Product.model = Laptop.model AND Laptop.ram > 16;
2.
 SELECT Product.maker AS manufacturer
 FROM Product,PC
 WHERE Product.type = 'Printer' AND PC.price >= 800;
(Edited: 2019-11-06)
1. SELECT Product.maker AS manufacturer, Laptop.price, Laptop.model FROM Product,Laptop WHERE Product.model = Laptop.model AND Laptop.ram > 16; 2. SELECT Product.maker AS manufacturer FROM Product,PC WHERE Product.type = 'Printer' AND PC.price >= 800;

-- Nov 6 In-Class Exercise Thread
 1. SELECT maker AS manufacturer, price, model FROM Product, Laptop WHERE Laptop.ram > 16 AND Product.model = Laptop.model
 2. SELECT maker AS manufacturer FROM Product, PC WHERE Product.type = "printer" AND PC.price >= 800
1. SELECT maker AS manufacturer, price, model FROM Product, Laptop WHERE Laptop.ram > 16 AND Product.model = Laptop.model 2. SELECT maker AS manufacturer FROM Product, PC WHERE Product.type = "printer" AND PC.price >= 800

-- Nov 6 In-Class Exercise Thread
  1.) SELECT Product.maker AS manufacturer, Laptop.price, Laptop.model
   FROM Product,Laptop
   WHERE Product.model = Laptop.model AND Laptop.ram > 16;
  2.) (SELECT maker as manufacturer
   FROM Product, Printer
   WHERE Product.model = Printer.model AND Product.type = 'Printer')
   EXCEPT
   (SELECT maker as manufacturer
   WHERE Product.type = 'PC' AND Product.model = PC.model AND PC.price < 800);
1.) SELECT Product.maker AS manufacturer, Laptop.price, Laptop.model FROM Product,Laptop WHERE Product.model = Laptop.model AND Laptop.ram > 16; 2.) (SELECT maker as manufacturer FROM Product, Printer WHERE Product.model = Printer.model AND Product.type = 'Printer') EXCEPT (SELECT maker as manufacturer WHERE Product.type = 'PC' AND Product.model = PC.model AND PC.price < 800);

-- Nov 6 In-Class Exercise Thread
1.
SELECT Product.maker AS manufacturer, Laptop.price, Laptop.model
FROM Product, Laptop
WHERE Product.model = Laptop.model AND Laptop.ram > '16Gb';
2.
(SELECT Product.maker AS manufacturer
FROM Product
WHERE Product.model = Printer.model AND Product.type = 'Printer')
EXCEPT
(SELECT Product.maker AS manufacturer
FROM Product
WHERE Product.model = PC.model AND Product.type = 'PC' AND PC.price < 800);
(Edited: 2019-11-06)
1. SELECT Product.maker AS manufacturer, Laptop.price, Laptop.model FROM Product, Laptop WHERE Product.model = Laptop.model AND Laptop.ram > '16Gb'; 2. (SELECT Product.maker AS manufacturer FROM Product WHERE Product.model = Printer.model AND Product.type = 'Printer') EXCEPT (SELECT Product.maker AS manufacturer FROM Product WHERE Product.model = PC.model AND Product.type = 'PC' AND PC.price < 800);
[ Next ]
X