Database Tutorial

Course Tutorial Site

Site Admin

2NF Modeling

without comments

Week 3: Reading

The following are the reading articles:

2nd Normal Form (2NF)/p>

Learning Outcomes

  • Learn how to define and apply Second Normal Form (2NF).

Lesson Materials

Second Normal Form (2NF) exists when a table is already in first normal form and all non-key columns depend on all of the key columns, where the list of key columns goes from 1 to n. The list of key columns makes up the natural key of a table, or the list of columns that makes any row unique in a table. A table that has only a single column as the natural key, like a Vehicle Identification number, is automatically in second normal form.

A table that has two or more columns as a natural key may contain one or more non-key columns that has a partial dependency on one or a set of columns less than all the columns in the key (or primary key). This typically means you have created a table that contains two subjects. The following illustrations shows the architecture of the 1NF table before converting it to 2NF.

2rdnfdependencyproblem

You divide the table into two tables to fix this problem. Second normal form modeling finds and moves columns from a base table when they have a partial dependence on part of a primary key. They are generally made into an independent table. A foreign key replaces the column or columns in the base table, and it points to or has a functional dependency on the primary key in the new table.

2ndnfdependencydetail

The foreign key in the base table becomes part of the primary key. The remaining non-key columns depend wholly on the natural key of the original or base table. The following drawing represents the simplified outcome of creating second normal form table.

2ndnfdependency

Written by michaelmclaughlin

August 11th, 2018 at 4:53 pm

Posted in