Problem

Write programs that implement Algorithms 1 and 2.Algorithm 1Relational Decomposition into...

Write programs that implement Algorithms 1 and 2.

Algorithm 1

Relational Decomposition into BCNF with Nonadditive Join Property

Input: A universal relation R and a set of functional dependencies F on the attributes of R.

1. Set D:= {R} ;

2. While there is a relation schema Q in D that is not in BCNF do

{

choose a relation schema Q in D that is not in BCNF; find a functional dependency XY in Q that violates BCNF; replace Q in D by two relation schemas (QY) and (XY);

} ;

Algorithm 2

Relational Synthesis into 3NF with Dependency Preservation and Nonadditive Join Property

Input: A universal relation R and a set of functional dependencies F on the attributes of R.

1. Find a minimal cover G for F(use Algorithm 16.2).

2. For each left-hand-side X of a functional dependency that appears in G, create a relation schema in D with attributes {X⋃ {A1} ⋃ {A2} ... ⋃ {Ak} }, where XA1, XA2, ..., XAk are the only dependencies in G with X as left-hand-side (X is the key of this relation).

3. If none of the relation schemas in D contains a key of R, then create one more relation schema in D that contains attributes that form a key of R.7(Algorithm 16.2(a) may be used to find a key.)

4. Eliminate redundant relations from the resulting set of relations in the relational database schema. A relation R is considered redundant if R is a projection of another relation S in the schema; alternately, R is subsumed by S.8

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT