New Post has been published on Stump Blog
New Post has been published on http://stumpblog.com/an-introduction-to-database-normalization/
An introduction to database normalization
Database normalization is the process of organizing the data contained in a database. This consists of creating the tables and setting relationship between the tables according to the rules created for protecting the data and making database more flexible by eliminating inconsistency and redundancy.
What is database normalization?
Redundant data is just a waste and it needs a lot of disc space and creates problem in maintenance. A data changed in one place must take similar change in every place it is stored. This consistency is maintained by taking all the procedures and rules of database normalization. The other issues is the inconsistent dependency which creates difficulty in the accessing of data because of the missing of the path to find the data.
Each Data normalization rule is called normal form. If the first rule of the database normalization is observed in the database, the database is said to be in the first normal form. Similarly if the database is said to be in the third normal form it means that all the first 3 rules of normalization are observed in it. Though there are more levels of normalization but the third normal form is considered the highest level necessary for most of the applications. Let us go over the three normalization forms-
First normal form includes the following rules-
· Elimination of repeated groups in tables
· Creating a separate table for every set of related data
· Assigning a primary key for identifying every set of related data
For example – You may store vendor records with vendor 1 and vendor 2 fields for 2 separate vendors in inventory records table. If you want to add a different vendor you have to create vendor 3 field which is not recommended. Instead place all vendors in a separate table and link inventor to vendors with an item number key or vendors with inventory with a vendor number key.
The second normal form includes the following rules-
· Creating separate tables for all set of values which apply to multiple records
· Assigning foreign key to these tables
Consider customer address field in accounting system. This address is needed in Customers table but it is also used by shipping, orders, invoices, collection etc. Do not make separate entry of address in each of these tables. Instead store it in a one place either in Customers table or as a separate table of Addresses.
This Third database normalization rule says-
· Elimination of all fields which do not depend on a key
The values which are not a part of the record’s key should not belong to the table. So the general rule is, if the contents of a group of fields apply to more than one record in a table, move those fields to a separate table.