Normalisation - 2NF vs 3NF

Marcus picture Marcus · May 16, 2011 · Viewed 35.1k times · Source

Struggling to see the differences between them. I know we say 2NF is "the whole key" and 3NF "nothing but the key".

Referencing this great answer by Smashery: What are 1NF, 2NF and 3NF in database design?

The example used for 3NF is exactly the same as 2NF - its a field which is dependant on only one key attribute. How is the example for 3NF different from the one for 2NF?

Thanks

Answer

nvogel picture nvogel · May 17, 2011

Suppose that some relation satisifies a non-trivial functional dependency of the form A->B, where B is a nonprime attribute.

2NF is violated if A is not a superkey but is a proper subset of a candidate key

3NF is violated if A is not a superkey

You have spotted that the 3NF requirement is just a special case (but not really so special) of the 2NF requirement. 2NF in itself is not very important. The important issue is whether A is a superkey, not whether A just happens to be some part of a candidate key.