Quick and short: Database Normalization

By Ashish Khandelwal, December 17, 2009

This is my very first article under ‘Quick and Short’ edition. In this article, I will introduce the concept of normalization and take a brief look at the most common normal forms.

Read more Quick and Short articles.

What is Normalization?

Normalization is the process of efficiently organizing data in a database. There are two goals of the normalization process: 1) eliminating redundant data (for example, storing the same data in more than one) and 2) ensuring data dependencies make sense (only storing related data in a table). Both of these are worthy goals as they reduce the amount of space a database consumes and ensure that data is logically stored.

 The Normal Forms

The database community has developed a series of guidelines for ensuring that databases are normalized. These are referred to as normal forms and are numbered from one (the lowest form of normalization, referred to as first normal form or 1NF) through five (fifth normal form or 5NF). In practical applications, you’ll often see 1NF, 2NF, and 3NF along with the occasional 4NF. Fifth normal form is very rarely seen and won’t be discussed in this article.

Before I begin my discussion of the normal forms, it’s important to point out that they are guidelines and guidelines only. Occasionally, it becomes necessary to stray from them to meet practical business requirements. However, when variations take place, it’s extremely important to evaluate any possible ramifications they could have on your system and account for possible inconsistencies. That said, let’s explore the normal forms.

 

First Normal Form (1NF)

  • Make a separate table for each set of related attributes, and give each table a primary key.

Second Normal Form (2NF)

  • Meet all the requirements of the first normal form.
  • Remove subsets of data that apply to multiple rows of a table and place them in separate tables.
  • Create relationships between these new tables and their predecessors through the use of foreign keys.

E.g. City, Country, Address table. Instead of storing City and Country information directory in the address table, create City and Country table, and make a relation with address table using foreign keys.

Third Normal Form (3NF)

  • Meet all the requirements of the second normal form.
  • Eliminate Columns Not Dependent on Key – If attributes do not contribute to a description of the key, remove them to a separate table.

Fourth Normal Form (4NF)

  • Meet all the requirements of the third normal form.
  • A relation is in 4NF if it has no multi-valued dependencies.

 

Fifth Normal Form (5NF)

  • Meet all the requirements of the forth normal form.
  • Every join dependency for the entity is a consequence of its candidate keys.

 

Readers are requested to add comment, and add more information in case they want.

Read more Quick and Short articles.

VN:F [1.7.2_963]
Rating: 5.0/5 (1 vote cast)

One Response to “Quick and short: Database Normalization”

  1. satya phani says:

    hi ASHISH! u did a great job. ur articles r really helpful to people who also intended to attend inteviews. really god b vit u always n encourage to do such more things… thank u very much…. keep it up…

Leave a Reply