I have a homework question that I am trying to understand but having a tough time with this question. Any explanation or even pointers would be very appreciated (no exact answer expected – I am trying to learn – but any help would be great).
I have two relations with a set of explicitly defined constraints.
D = {R1:CDE, R2:FGH} Constraints = {R1: CD->E, R2:key(G), R1[DE] subset R2[FG]}
Are the two relations (D={R1 and R2}
) in BCNF?
Thank you for any guidance you can provide.
Best Answer
A relation is in BCNF if every determinant of the non-trivial dependencies is a superkey.
If
G
is the key ofR2
, we know thatG → F
andG → H
.Since
DE
inR1
is a subset ofFG
inR2
, and sinceG → F
, we can easily prove thatE → D
inR1
.If no other constraint holds on
R1
, then we can calculate the candidate keys ofR1
starting from the two dependenciesCD → E
andE → D
, and see ifR1
is in BCNF or not.Finally note that, if no other constraint is known on
R2
a part from the key, it is very easy to decide if it in BCNF or not.