Can anyone explain me 1NF, 2NF, 3NF, BCNF rules with a proper example?

Vishwanath Dalvi picture Vishwanath Dalvi · Jan 14, 2011 · Viewed 20k times · Source

This is a common interview question. I faced one interview where the interviewer gave me one table and asked me tell him which normal form the table is in? If it's in ##NF, then normalize it to the next NF?

I'm always get confused between these normal forms of database. Can anyone explain to me these normal forms with a proper example of how each NF is modeled into table so it will help in my next interview?

Answer

nvogel picture nvogel · Jan 14, 2011

Boyce Codd Normal Form is really the most important and also the easiest to explain: Every non-trivial determinant is a superkey (just remember "arrows out of superkeys"). The lesser normal forms are only worth mentioning because BCNF is not dependency-preserving in a few cases.

Examples of BCNF and 5NF by Hugh Darwen:

For more mathematical definitions (Abiteboul et al):