March 31st, 2009

Normalizing the Database (Part 3 of 5), Second Normal Form

Posted by admin in O. Database Objects

Before we get into second normal form (2NF), note that if the primary key is a single column, or all the columns in the table are part of the primary key, then the table is already in second normal form.

A table in second normal form must be in first normal form and have no partial functional dependencies.

A partial functional dependency is when some, but not all of a composite key’s values determine a non-key column’s value.

To avoid this, a second normal form table is fully functionally dependent. That means that all non-key attributes (or columns) must depend on all components of the key. If the table has some non-key attributes that do not depend on all components of the key, break the table up into two or more tables so that, in each table, all non-key attributes depend on all components of the primary key.

March 30th, 2009

Normalizing the Database (Part 2 of 5), First Normal Form

Posted by admin in O. Database Objects

To have a table in first normal form (1NF):

> The table must be two-dimensional with rows and columns describing a table object.

> Each row must have data that relates to the table object and no two rows can be identical.
Each table must have a primary key that uniquely identifies every row.
The primary key can consist of one column (simple key) or multiple columns (composite key).

> Each column must have a unique column name and contain data that describes an attribute of the table object and all of the column values must describe only that single attribute.
Each column must be consistent with a single data type. If this column is for a numeric phone number, then all entries in this column can only be numeric phone numbers.

> Each row and column value must be only a single value.

March 27th, 2009

Normalizing the Database (Part 1 of 5)

Posted by admin in O. Database Objects

The process of “normalizing” tables into first, second, and third normal form (1NF, 2NF, 3NF) insures that your database will be simple, logical, and not have redundacies or inconsistencies.

First, convert your tables into first normal form (1NF). The normal forms are nested.

Converting to second normal form (2NF) can only be done after doing first normal form (1NF).

Converting to third normal form (3NF) can only be done after doing second normal form (2NF).

There are fourth and fifth normal forms (4NF, 5NF) as well as a domain-key normal form (DKNF) that give a higher degree of protection against modification anomolies.

Normalization is a repetitive process that involves repeatedly splitting and rejoining tables until the database designer is happy with the result.

Next Page »