SQL Database Design » 14. Normalization » 14.5 Second Normal Form

14.5 Second Normal Form

The second normal form (2NF) makes use of one specific type of functional dependencies. Pascal defines 2NF as following: If all [non-key] columns are functionally dependent on the whole key (not just a part thereof) ..., a table is in second normal form (2NF).

Detecting 2NF without data is rather hard when compared to 1NF. It works best when looking at actual data and analyzing the functional dependencies. Of course, it can also be done if you are able to foresee and imagine the data.

Using one-column (usually artificial) primary keys automatically avoids problems concerning 2NF, because the 2NF rule is not applicable to single-colum primary keys. As a consequence, all 1NF tables that use single-column primary keys are in 2NF, too. So, if you avoid collective (and structured) types and use single-column primary keys exclusively, your database will always be in 2NF. Note though, that this practice is not advised, because it does not mean you have a good design. Never use single-columm primary keys only to reach 2NF.

Last updated: 2010-08-04