Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write the following queries, based on the database schema Product(maker, model,

ID: 672981 • Letter: W

Question

Write the following queries, based on the database schema Product(maker, model, type) PC(model, speed, ram, hd, price) Laptop(model, speed, ram, hd, screen, price) Printer(model, color, type, price) of You should use at least one subquery in each of your answers and write each query in two significantly different ways (e.g., using different sets of the operators EXISTS, IN, ALL, and ANY).Find the makers of PC's with a speed of at least 3.0. Find the printers with the highest price. Find the laptops whose speed is slower than that of any PC. Find the model number of the item (PC, laptop, or printer) with the highest price. Find the maker of the color printer with the lowest price. Find the maker(s) of the PC(s) with the fastest processor among all those PC's that have the smallest amount of RAM.

Explanation / Answer

A) select m.market from product m ,PC p where p.speed >= '3.0' and p.model = m.model;

B) select * from printer where price in (select max(price) from printer);

C) select model from laptop where speed in ((select min(speed) from laptop);

D) select p.model,l.model,pc.model from PC pc,laptop l,model p where p.model = l.model and l.model = pc.model and pc.model = p.model;

E)select p.maker from product p,printer pr where pr.type = 'color' and p.model = pr.model and price in (select min(price) from pr.printer));

F) select p.maker from PC c,product p where speed in (select max(speed) from c.PC and ram in (select min(ram) from c.PC) and c.model = p.model;