Tuesday, May 27, 2014

Overview of Database Normalization

Normalization reduces data redundancy and inconsistent data dependency to avoid all anamolites(Deletion,Insertion and updation)

1NF: No Repeiting Column value
2NF: No Partial functional dependency
3NF: No Transitive dependency

A database table is said to be in 1NF if it contains no repeating fields/columns
Separate the repeating fields into new database tables along with the key from unnormalized database table.
The primary key of new database tables may be a composite key
A database table is said to be in 2NF if it is in 1NF and contains only those fields/columns that are functionally dependent(means the value of field is determined by the value of another field(s)) on the primary key
Remove the partial dependencies(A type of functional dependency where a field is only functionally dependent on the part of primary key) of any non-key field.
If field B depends on field A and vice versa. Also for a given value of B, we have only one possible value of A and vice versa, Then we put the field B in to new database table where B will be primary key and also marked as foreign key in parent table.
A database table is said to be in 3NF if it is in 2NF and all non keys fields should be dependent on primary key(2NF) and no fields of the table is transitively functionally dependent on the primary key.
    Remove the transitive dependecies(A type of functional dependency where a field is functionally dependent on the Field that is not the primary key.Hence its value is determined, indirectly by the primary key )
Make separate table for transitive dependent Field.


KEY that can uniquely determine records

https://www.youtube.com/watch?v=G9SA0Yv-o28
https://www.simple-talk.com/community/forums/thread/111401.aspx
http://holowczak.com/database-normalization/


No comments:

Post a Comment