Writing Queries Based on Schemas
Consider the following database schema:
Product(maker, model, type)
PC(model, speed, ram, hd, price)
Laptop(model, speed, ram, hd, screen, price)
Printer(model, color, type, price)
Write the following queries based on above schema. Use a sub-query in each answer.
a) Find the model number of the item (PC, laptop, or printer) with the highest price.
b) Find the maker of the color printer with the lowest price.
c) Find the maker(s) of the PC(s) with the fastest processor among all those PCs that have the smallest amount of RAM.
https://brainmass.com/computer-science/processor-architectures/writing-queries-based-on-schemas-313351
Solution Preview
Following are requested queries.
a) Find the model number of the item (PC, laptop, or printer) with the highest price.
SELECT TOP 1 p.price, p.model FROM
(
select model, price from Printer WHERE Printer.price = (SELECT ...
Solution Summary
This solution helps with a problem regarding writing queries based on schemas. It helps find the model number of the item, the maker of the color printer with the lowest price, and the maker of the PC with the fastest processor among all the PCs.