Starting from:

$30

CSE111–Quiz 1 retake Solved

DATABASESYSTEMS

 (30 points)

Consider the following relational schema, provided as a SQLite database populated with sample data:

•    Product(maker, model, type)

•    PC(model, speed, ram, hd, price)

•    Laptop(model, speed, ram, hd, screen, price)

•    Printer(model, color, type, price)

Write SQL statements for the following queries (5 points each) in the given quiz-1.sql file:

1.    What makers produce Laptops cheaper than $2000 with a screen larger than 16?

2.    What makers produce PCs but do not produce Laptops?

3.    For every maker that sells both PCs and Printers, find the combination of PC and Printer that hasmaximum price. Print the maker, the PC model, Printer model, and the combination price (PC price + Printer price).

4.    What Laptop hd sizes are offered in at least 2 different models?

5.    What PCs are less expensive than all the Laptops? Print the model and the price.

6.    What makers produce at least a Laptop model and at least 2 Printer models?

We will grade your quiz by running the quiz-1.sql file on the given database and another database populated with different data. So, make sure your SQL statements are general. You should test that your code works without errors by running the command sqlite3 data.sqlite < quiz-1.sql in the terminal. quiz-1.sql is the only file you have to turn in.

More products