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:

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
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, ram, 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.
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.
2.4. AN ALGEBRAIC QUERY LANGUAGE
maker model type
1001 рс
1002 pc.
1003 pc
A
A
A
A
A
A
B
B
B
B
с
D
D
D
D
D
E
E
E
E
E
E
E
E
E
F
F
G
H
H
2004 laptop
2005 laptop
laptop
2006
1004
рс
1005 рс
1006 pc
2007 laptop
1007 рс
pc.
pc
рс
1008
1009
1010
3004 printer
3005
printer
1011
pc
1012 pc
pc
1013
2001 laptop
2002
laptop
2003
laptop
3001
printer
3002 printer
3003 printer
2008 laptop
2009
laptop
2010 laptop
3006 printer
3007 printer
Figure 2.20: Sample data for Product
53
Transcribed Image Text: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, ram, 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. 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. 2.4. AN ALGEBRAIC QUERY LANGUAGE maker model type 1001 рс 1002 pc. 1003 pc A A A A A A B B B B с D D D D D E E E E E E E E E F F G H H 2004 laptop 2005 laptop laptop 2006 1004 рс 1005 рс 1006 pc 2007 laptop 1007 рс pc. pc рс 1008 1009 1010 3004 printer 3005 printer 1011 pc 1012 pc pc 1013 2001 laptop 2002 laptop 2003 laptop 3001 printer 3002 printer 3003 printer 2008 laptop 2009 laptop 2010 laptop 3006 printer 3007 printer Figure 2.20: Sample data for Product 53
54
CHAPTER 2. THE RELATIONAL MODEL OF DATA
model speed ram | hd
hd
price
1001 2.66 1024 250 2114
1002 2.10
512 250
995
512 80
478
1003 1.42
1004 2.80 1024 250
649
1005 3.20 512 250
630
1006 3.20 1024 320
1049
510
1007 2.20 1024 200
1008 2.20
2048 250
1009 2.00 1024 250
770
650
1010 2.80 2048 300
770
959
1011 1.86 2048 160
1012 2.80 1024 160 649
1013 3.06 512 80 529
(a) Sample data for relation PC
model speed ram hd screen
price
2001 2.00 2048 240 20.1 3673
2002 1.73 1024 80
17.0
949
549
1150
2003 1.80 512 60 15.4
2004 2.00 512 60 13.3
2005 2.16
1024 120 17.0
2006 2.00 2048 80 15.4
2500
1700
2007
1429
1.83
1024 120 13.3
1.60 1024 100 15.4
2008
900
680
2009 1.60 512 80 14.1
2010 2.00 2048 160 15.4 2300
(b) Sample data for relation Laptop
model color type
3001 true ink-jet
3002 false
laser
laser
price
99
239
899
120
120
100
200
3003 true
3004 true
3005 false laser
3006 true
ink-jet
3007 true laser
(c) Sample data for relation Printer
Figure 2.21: Sample data for relations of Exercise 2.4.1
ink-jet
2.4. AN ALGEBRAIC QUERY LANGUAGE
! g) Find those pairs of PC modeis that have both the same speed and RAM.
A pair should be listed only once; e.g., list (i, j) but not (j, i).
55
!! h) Find those manufacturers of at least two different computers (PC's or
laptops) with speeds of at least 2.80.
!! i) Find the manufacturer(s) of the computer (PC or laptop) with the highest
available speed.
!! j)
Find the manufacturers of PC's with at least three different speeds.
!! k) Find the manufacturers who sell exactly three different models of PC.
Transcribed Image Text:54 CHAPTER 2. THE RELATIONAL MODEL OF DATA model speed ram | hd hd price 1001 2.66 1024 250 2114 1002 2.10 512 250 995 512 80 478 1003 1.42 1004 2.80 1024 250 649 1005 3.20 512 250 630 1006 3.20 1024 320 1049 510 1007 2.20 1024 200 1008 2.20 2048 250 1009 2.00 1024 250 770 650 1010 2.80 2048 300 770 959 1011 1.86 2048 160 1012 2.80 1024 160 649 1013 3.06 512 80 529 (a) Sample data for relation PC model speed ram hd screen price 2001 2.00 2048 240 20.1 3673 2002 1.73 1024 80 17.0 949 549 1150 2003 1.80 512 60 15.4 2004 2.00 512 60 13.3 2005 2.16 1024 120 17.0 2006 2.00 2048 80 15.4 2500 1700 2007 1429 1.83 1024 120 13.3 1.60 1024 100 15.4 2008 900 680 2009 1.60 512 80 14.1 2010 2.00 2048 160 15.4 2300 (b) Sample data for relation Laptop model color type 3001 true ink-jet 3002 false laser laser price 99 239 899 120 120 100 200 3003 true 3004 true 3005 false laser 3006 true ink-jet 3007 true laser (c) Sample data for relation Printer Figure 2.21: Sample data for relations of Exercise 2.4.1 ink-jet 2.4. AN ALGEBRAIC QUERY LANGUAGE ! g) Find those pairs of PC modeis that have both the same speed and RAM. A pair should be listed only once; e.g., list (i, j) but not (j, i). 55 !! h) Find those manufacturers of at least two different computers (PC's or laptops) with speeds of at least 2.80. !! i) Find the manufacturer(s) of the computer (PC or laptop) with the highest available speed. !! j) Find the manufacturers of PC's with at least three different speeds. !! k) Find the manufacturers who sell exactly three different models of PC.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Hey, can you answer all the questions from ‘a’to ‘k’? I only see 3 answered here. Thank you

Solution
Bartleby Expert
SEE SOLUTION
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY