MInH THiỆn
MInH THiỆn

Reputation: 59

attribute partially depends on a candidate key but the answer says the relation is in 3NF

The relation R(ABCD) has the following non-trivial FDs that hold: { A -> B ; B -> A ; A -> D ; D -> B }

What is the highest normal form of R?

Since A -> B is extraneous, I removed it to simplify things. The remaining set of FDs which I believe is also a cover: { B -> A ; A -> D ; D -> B }

By calculating the closures, I got: {A}+ = {B}+ = {D}+ = ABD.

Since C is not present in any FDs, if I want to find a key, I would have to add C to {A}, {B} and {C}. With that in mind, I got AC, BC, and DC as candidate keys as {AC}+ = {BC}+ = {DC}+ = ABCD.

With those candidate keys and the FDs, for example, A -> B, B would partially depend on AC since this implies B depends on A, not AC - the key.

If this is true, R is not 2NF because 2NF does not allow partial dependency on the candidate keys.

The answer given is that R is in 3NF, which confuses me because 3NF requires the Relation to be in 2NF first.

My question is: is the Relation's highest NF is 3NF? If so, what is wrong in my reasoning?

Edit: After revise the definition of Partial Dependency and conditions of 2NF in my lecture slides, they are as such:

"Partial dependency - when a non-key attribute is determined by a part, but not the whole, of a COMPOSITE primary key."

"2NF: A relation R is in second normal form (2NF) if and only if it is in 1NF and every non-key attribute is fully dependent on the primary key "

As I mentioned above, AC, BC and DC are candidate keys, so A, B and D are key-attributes because they belong to a key.

While B is indeed partially depending on AC because of the FD: A -> B, B is a key-attribute so it does not violate the second condition of 2NF because it only mentions non-key attributes, there is C, but C is not included in the FDs. So R is indeed in 2NF, the same reasoning applies for B and D. Are my reasoning correct?

Upvotes: 0

Views: 167

Answers (0)

Related Questions