Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Normalisation - 2NF vs 3NF

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

like image 550
Marcus Avatar asked May 16 '11 20:05

Marcus


People also ask

What is normalization 2NF and 3NF example?

A relation is in 1NF if it contains an atomic value. 2NF. A relation will be in 2NF if it is in 1NF and all non-key attributes are fully functional dependent on the primary key. 3NF. A relation will be in 3NF if it is in 2NF and no transition dependency exists.

What is 1NF 2NF 3NF and BCNF?

1st Normal Form (1NF) Second Normal Form (2NF) Third Normal Form (3NF) Boyce CoddNormal Form (BCNF)


1 Answers

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.

like image 123
nvogel Avatar answered Sep 22 '22 17:09

nvogel