简体   繁体   中英

Can a relation in Boyce-Codd Normal Form have functional dependencies between prime attributes?

My question is pretty simple. From what I've seen, it seems normalization from 1NF, 2NF, 3NF up to Boyce-Codd form seem to deal mostly the matter of non-prime attributes. If I am not mistaken, then, the following table is in Boyce-Codd form:

R(A,B,C), F = {AB->C, A->B}

with A,B being a compound primary key, which would seem odd to me.

Am I missing something here?

If A->B then {AB} can't possibly be a primary key because it isn't minimal. Assuming therefore that A is the only key then R is in at least BCNF with respect to the dependencies AB->C, A->B.

If A determines B (A -> B) then saying that AB determines C (AB -> C) implies that A determines C (A -> C).

Saying A -> B means that there are no two records where the B columns have different values but the A columns have the same value.

Saying AB -> C means that there are no two records where the C columns have different values but both the A and B columns have the same value. Although, because A -> B, we already know that if the A columns have the same value then the B columns also have the same value. Thus, we can say that, seeing that A -> B then AB -> C implies A -> C.

Thus, the FDs in R are:

  1. A -> B
  2. A -> C

For a relation to be in BCNF the following must hold:

  1. It must already be in 3NF
  2. There mustn't be non-trivial functional dependencies where the determinant is not a super key

As you already have a relation in 3NF, as you stated, we satisfy the 1st condition. As in all of R's FDs the determinant is a super key (A is a super key), we satisfy the 2nd condition.

Thus, R is in BCNF.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM