简体   繁体   中英

Boyce-Codd Normal Form explain

Accoring to Boyce-Codd Normal Form Definition,

Reln R with FDs F is in BCNF if, for all X -> A in F+ -A is subset of X (called a trivial FD), or -X is a superkey for R.

 “R is in BCNF if the only non-trivial FDs over R are key constraints.”

 If R in BCNF, then every field of every tuple records information that 
 cannot be inferred using FDs alone.

What I dont understand is the above two statements about normal form,

Can someone give me an example?

Thanks!

Some Pre-requisite terms before I try to Explain:

Non-key attribute : An attribute that is not part of any candidate key is known as non-key /non-prime attribute.

Superkey : A set of attributes within a table whose values can be used to uniquely identify a tuple. A candidate key is a minimal set of attributes necessary to identify a tuple; this is also called a minimal superkey.

Now, BCNF is the advance version of 3NF, stricter than 3NF.

A table is in BCNF if every functional dependency X → Y, X is the super key of the table.

Consider a relation : R(A,B,C,D)

The dependencies are:

A->BCD

BC->AD

D->B

So, Candidate keys(or minimal super keys) are A and BC.

But in dependency: D->B, D is not a superkey.

Hence it violates BCNF form.

We can break this relation into R1 and R2 as:
R1(A,D,C) and R2(D,B) to get 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