2.4.14 Exercises for Section 2.4 Exercise 2.4.1: This exercise builds upon the products schema of Exercise 2.3.1. Recall that the database schema consists of four relations, whose schemas are: Product (maker, model, type) PC (model, speed, ran, hd, price) Laptop (model, speed, ram, hd, screen, price) Printer (model, color, type, price) Some sample data for the relation Product is shown in Fig. 2.20. Sample data for the other three relations is shown in Fig. 2.21. Manufacturers and model numbers have been "sanitized," but the data is typical of products on sale at the beginning of 2007. Write expressions of relational algebra to answer the following queries. You may use the linear notation of Section 2.4.13 if you wish. For the data of Figs. 2.20 and 2.21, show the result of your query. However, your answer should work for arbitrary data, not just the data of these figures. a) What PC models have a speed of at least 3.00? b) Which manufacturers make laptops with a hard disk of at least 100GB? c) Find the model number and price of all products (of any type) made by manufacturer B.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
**2.4.14 Exercises for Section 2.4**

**Exercise 2.4.1:** This exercise expands on the products schema from Exercise 2.3.1. The database schema consists of four relations, with the following schemas:

- **Product**(maker, model, type)
- **PC**(model, speed, ram, hd, price)
- **Laptop**(model, speed, ram, hd, screen, price)
- **Printer**(model, color, type, price)

Sample data for the relation "Product" is shown in Figure 2.20, while sample data for the other three relations is shown in Figure 2.21. Manufacturers and model numbers have been “sanitized,” but the data is typical of products as of 2007.

You are to write expressions of relational algebra to answer the following queries. Use the linear notation of Section 2.4.13 if you wish. For the data of Figures 2.20 and 2.21, show the result of your query. However, your answer should work for arbitrary data, not just the data of these figures.

**Queries:**

a) What PC models have a speed of at least 3.00?

b) Which manufacturers make laptops with a hard disk of at least 100GB?

c) Find the model number and price of all products (of any type) made by manufacturer B.

d) Find the model numbers of all color laser printers.

e) Find those manufacturers that sell Laptops, but not PC’s.

f) Find those hard-disk sizes that occur in two or more PC’s.

---

**Figure 2.20: Sample data for Product**

The table presents sample data for Products with the following attributes: maker, model, and type.

| maker | model | type   |
|-------|-------|--------|
| A     | 1001  | pc     |
| A     | 1002  | pc     |
| A     | 1003  | pc     |
| A     | 2004  | laptop |
| A     | 2005  | laptop |
| A     | 2006  | laptop |
| B     | 1004  | pc     |
| B     | 1005  | pc     |
| B     | 1006  | pc     |
| B     | 2007  | laptop |
Transcribed Image Text:**2.4.14 Exercises for Section 2.4** **Exercise 2.4.1:** This exercise expands on the products schema from Exercise 2.3.1. The database schema consists of four relations, with the following schemas: - **Product**(maker, model, type) - **PC**(model, speed, ram, hd, price) - **Laptop**(model, speed, ram, hd, screen, price) - **Printer**(model, color, type, price) Sample data for the relation "Product" is shown in Figure 2.20, while sample data for the other three relations is shown in Figure 2.21. Manufacturers and model numbers have been “sanitized,” but the data is typical of products as of 2007. You are to write expressions of relational algebra to answer the following queries. Use the linear notation of Section 2.4.13 if you wish. For the data of Figures 2.20 and 2.21, show the result of your query. However, your answer should work for arbitrary data, not just the data of these figures. **Queries:** a) What PC models have a speed of at least 3.00? b) Which manufacturers make laptops with a hard disk of at least 100GB? c) Find the model number and price of all products (of any type) made by manufacturer B. d) Find the model numbers of all color laser printers. e) Find those manufacturers that sell Laptops, but not PC’s. f) Find those hard-disk sizes that occur in two or more PC’s. --- **Figure 2.20: Sample data for Product** The table presents sample data for Products with the following attributes: maker, model, and type. | maker | model | type | |-------|-------|--------| | A | 1001 | pc | | A | 1002 | pc | | A | 1003 | pc | | A | 2004 | laptop | | A | 2005 | laptop | | A | 2006 | laptop | | B | 1004 | pc | | B | 1005 | pc | | B | 1006 | pc | | B | 2007 | laptop |
**Chapter 2: The Relational Model of Data**

This section includes sample data for three different relations: PC, Laptop, and Printer as part of Exercise 2.4.1. The data is presented in tables with specific attributes for each category.

**(a) Sample data for relation PC**

The table contains five columns labeled 'model', 'speed', 'ram', 'hd', and 'price'. Here are some example entries:

- 1001 | 2.66 | 1024 | 250 | 2114
- 1002 | 2.10 | 512 | 250 | 995
- 1003 | 1.42 | 512 | 80 | 478

**(b) Sample data for relation Laptop**

This table includes columns labeled 'model', 'speed', 'ram', 'hd', 'screen', and 'price'. Some example entries are:

- 2001 | 2.00 | 2048 | 240 | 20.1 | 3673
- 2002 | 1.73 | 1024 | 80 | 15.0 | 949
- 2003 | 1.80 | 512 | 60 | 15.4 | 549

**(c) Sample data for relation Printer**

The table has columns labeled 'model', 'color', 'type', and 'price'. Example entries include:

- 3001 | true | ink-jet | 99
- 3002 | false | laser | 239
- 3003 | true | laser | 899

**Figure 2.21** displays the sample data for these relations, providing a basis for the exercises in this chapter.

**2.4 An Algebraic Query Language**

The directives involve querying the presented data. Some tasks include:

- Find pairs of PC models with the same speed and RAM.
- Identify manufacturers of at least two computers with speeds of at least 2.80.
- Discover the manufacturer(s) of the computer with the highest speed.
- Determine manufacturers of PCs with at least three different speeds.
- Identify manufacturers selling exactly three different models of PCs.

These exercises are intended to explore the relational data model using an algebraic query language.
Transcribed Image Text:**Chapter 2: The Relational Model of Data** This section includes sample data for three different relations: PC, Laptop, and Printer as part of Exercise 2.4.1. The data is presented in tables with specific attributes for each category. **(a) Sample data for relation PC** The table contains five columns labeled 'model', 'speed', 'ram', 'hd', and 'price'. Here are some example entries: - 1001 | 2.66 | 1024 | 250 | 2114 - 1002 | 2.10 | 512 | 250 | 995 - 1003 | 1.42 | 512 | 80 | 478 **(b) Sample data for relation Laptop** This table includes columns labeled 'model', 'speed', 'ram', 'hd', 'screen', and 'price'. Some example entries are: - 2001 | 2.00 | 2048 | 240 | 20.1 | 3673 - 2002 | 1.73 | 1024 | 80 | 15.0 | 949 - 2003 | 1.80 | 512 | 60 | 15.4 | 549 **(c) Sample data for relation Printer** The table has columns labeled 'model', 'color', 'type', and 'price'. Example entries include: - 3001 | true | ink-jet | 99 - 3002 | false | laser | 239 - 3003 | true | laser | 899 **Figure 2.21** displays the sample data for these relations, providing a basis for the exercises in this chapter. **2.4 An Algebraic Query Language** The directives involve querying the presented data. Some tasks include: - Find pairs of PC models with the same speed and RAM. - Identify manufacturers of at least two computers with speeds of at least 2.80. - Discover the manufacturer(s) of the computer with the highest speed. - Determine manufacturers of PCs with at least three different speeds. - Identify manufacturers selling exactly three different models of PCs. These exercises are intended to explore the relational data model using an algebraic query language.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Dataset
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education