Functional dependencies keys and normal form

172 views Asked by At

I am trying to understand functional dependencies

Let's say we have R with {A,B,C,D,E} and FDs A->B, BC->E and ED->A.

What are the keys and is R in 3NF or BCNF?

3

There are 3 answers

1
Karup On

The keys here are — ACD, BCD and ECD. Since each attribute of the relation R comes at least once in each of the keys, all the attributes in your relation R are prime attributes.

Note that if a relation has all prime attributes then it is already in 3NF.

Hence the given relation R is in 3NF.

To be in BCNF, for each functional dependency X->Y, X should be a key. We see that the very first dependency ( A->B ) violates this and hence the relation R is not in BCNF.

0
Bhavya On

The keys are — ACD, BCD and ECD.

Prime attributes will be (A,B,C,D,E) because all are coming in primary key.

Note that if a relation has all prime attributes then it is already in 3NF.

Hence the given relation R is in 3NF.

To be in BCNF, for each functional dependency X->Y, X should be a superkey. We see that the very first dependency ( A->B ) violates this and hence the relation R is not in BCNF.

0
Shantanu On

The candidate keys are - ACD,BCD and ECD. Prime attributes are (A,B,C,D,E) because they are all in primary keys. Now, first we check the relation for BCNF For BCNF, in the FD's the left side in the attribute must be a super key and as you can notice that not any FD follows this condition For 3NF, in the FD's there are two conditions: 1. Either the left side be a super key 2. If the first conditions fails, then the right side of the same FD must be a prime attribute. if the relation follows these conditions, then it is in 3NF and as we can notice all the attributes are prime attributes, the following relation R is in 3NF but not in BCNF.