Exercises 257Given table RA,B,C and the set {R1A,B, R2B,C} satisfies the loss-less decomposition property: 1.. Given table RA,B,C with actual data shown below: a.. Transform your ER or U
Trang 1Exercises 257
Given table R(A,B,C) and the set {R1(A,B), R2(B,C)} satisfies the loss-less decomposition property:
1 Does the multivalued dependency B->>C hold?
2 Is B a candidate key?
3 Is R in 4NF?
Given a table “skills_available” with attributes empno, project, and skill, in which the semantics of “skills_available” state that every skill an employee has must be used on every project that employee works on:
1 Is the level of normalization of “skills_available” at least 4NF?
2 Given table R(A,B,C) with actual data shown below:
a Does the multivalued dependency B->>C hold?
b Is R in 5NF?
Logical Database Design (Generic Problem)
Problem 7-1
Design and implement a small database that will be useful to your com-pany or student organization
1 State the purpose of the database in a few sentences
2 Construct an ER or UML class diagram for the database
3 Transform your ER or UML diagram into a working database with five to ten rows per table of data you can make up to fit the
Trang 2data-258 Exercises
base schema You should have at least four tables, enough to have some interesting queries Use Oracle, DB2, SQL Server, Access, or any other database system
4 Show that your database is normalized (BCNF) using FDs derived from your ER diagram and from personal knowledge of the data Analyze the FDs for each table separately (this simplifies the pro-cess)
5 Demonstrate your working database by displaying the results of four queries Pick interesting and complex queries (impress us!)
OLAP
Problem 8-1
As mentioned in Chapter 8, hypercube lattice structures are a specializa-tion of product graphs Figure 8.16 shows an example of a three-dimen-sional hypercube lattice structure Figure 8.13 shows an example of a two-dimensional product graph Notice that the two figures are written using different notations Write the hypercube lattice structure in Figure 8.16 using the product graph notation introduced with Figure 8.13 Keep the same dimension order Don’t worry about carrying over the view sizes Assume the Customer, Part, and Supplier dimensions are keyed by
“customer id,” “part id,” and “supplier id,” respectively Shade the nodes representing the fact table and the views selected for materialization as indicated in Section 8.2.4
Trang 3Solutions to Selected
Exercises
Problem 2-2
Trang 4260 Solutions to Selected Exercises
Problem 4-1
Connect Movie to Video-copy as a 1-to-N relationship (Video-copy at the N side); or, use a generalization from Movie to Video-copy, with
Movie being the supertype and Video-copy as the subtype
Problem 6-1
Given the table R1(A, B, C) with FDs A -> B and B -> C:
3 Is this table in 3NF, BCNF, or neither? Neither 3NF nor BCNF
Problem 6-3
Problem 6-5
Given these FDs, begin Step 1 (LHS reduction):
1 J -> KLMNP
2 JKL -> MNP First, eliminate K and L since J -> KL in (1);
merge with (1)
Level of Normalization
item itemno -> deptno, itemname, size BCNF
orderno, deptno -> sid BCNF
Trang 5Solutions to Selected Exercises 261
3 K -> MQ
(4) is redundant
with (3)
6 N -> KP End of Step 1, begin Step 2 (RHS reduction for transitivities):
3 N -> KP End of Step 2 and consolidation in Step 3:
1 J -> KL
2 K -> MNQ (or K -> MNPQ) First, merge (2) and (3) for
superkey rules 1 and 2
3 N -> KP (or N -> K) Steps 4 and 5:
Problem 6-7
Given these FDs:
in (3)
B -> F from (5)
B -> AC -> G from (3) and (5)
5 B -> ACF