Let's break down the problem and solve it step by step.
Given:
Universal Relation R = {A, B, C, D, E, F, G, H, I, J}
Functional Dependencies F:
o {A, B} → {C}
o {A} → {D, E}
o {B} → {F}
o {F} → {G, H}
o {D} → {I, J}
Questions:
1. What is the key of R?
2. Decompose R into 2NF and then 3NF relations.
1. Determining the Key of R:
A key is a minimal superkey. To find the key, we need to determine the attribute closure of
combinations of attributes to see if they can determine all attributes in R.
Closure of {A, B}:
o {A, B}+ = {A, B, C, D, E, F, G, H, I, J}
o Since {A, B} can determine all attributes, {A, B} is a key.
Now, let's check if {A} or {B} alone is a key:
Closure of {A}:
o {A}+ = {A, D, E, I, J}
o {A} doesn't determine all attributes.
Closure of {B}:
o {B}+ = {B, F, G, H}
o {B} doesn't determine all attributes.
Since neither {A} nor {B} alone is a key, but {A, B} is, the candidate key for the relation is
{A, B}.
2. Decompose R into 2NF and then 3NF relations:
To decompose into 2NF, we must remove partial dependencies.
2NF Decomposition:
From the dependency {A} → {D, E}, create a new relation:
o R1(A, D, E)
From the dependency {B} → {F}, create a new relation:
o R2(B, F)
The original relation R will be decomposed into:
o R3(A, B, C)
Now, R1, R2, and R3 are in 2NF.
3NF Decomposition:
To further decompose into 3NF, we remove transitive dependencies.
From {F} → {G, H}, create a new relation:
o R4(F, G, H)
From {D} → {I, J}, create a new relation:
o R5(D, I, J)
Now, the final decomposed relations in 3NF are:
1. R1(A, D, E)
2. R2(B, F)
3. R3(A, B, C)
4. R4(F, G, H)
5. R5(D, I, J)
These relations are now in 3NF and free of partial and transitive dependencies.