NORMALIZATION Notes
NORMALIZATION Notes
Deletion Anamoly:
• If Employee_id 101 has only 1 department and we delete that temparary then Entire
student record will be deleted.
To Overcome these kind of issues there is need to use the database normalized forms.When we try
to normalize database check following 4 important points:
1.Arrangement of data into logical groups.
2.Minimize the Duplicate data.
3.Organize the data in such way that when modification needed then there should be only
one place modification required.
4.User can access and manipulate data quickly and efficiently.
First Normal Form/1st Normal Form:
The first normal form is the normal form of database where data must not contain repeating
groups.The database is in First normal form If,
Example:
Consider following table which is not normalized:
Employee Table:
Employee No Employee Name Department
1 Amit OBIEE,ETL
2 Divya COGNOS
3 Rama Administrator
• To bring it in to first normal form We need to split table into 2 tables.
• First table: Employee Table
1 Amit
2 Divya
3 Rama
Employee No Department
1 OBIEE
1 ETL
2 COGNOS
3 Administrator
•We have divided the table into two different tables and the column of each table is holding the
automic values and duplicates also removed.
2.Second Normal Form/2nd Normal Form:
• The data is said to be in second normalized form If,
1.It is in First normal form
2.There should not be any partial dependency of any column on primary key.Means the
table have concatanated primary key and each attribute in table depends on that concatanated
primary key.
• 3.All Non-key attributes are fully functionally dependent on primary key. If primary is is not
composite key then all non key attributes are fully functionally dependent on primary key.
Example:
• Let us consider following table which is in first normal form:
• In above example we can see that department .Here We will see that there is composit key
as{ Employee No,Department No}.Employee No is dependent on Employee Name and Department
is dependent on Department No.We can split the above table into 2 different tables:
• Table 1:Employee_NO table
1 101 Amit
2 102 Divya
3 101 Rama
101 OBIEE
102 COGNOS
• In above table Employee No determines the Salary Slip No. And Salary Slip no Determines
Employee name. Therefore Employee No determines Employee Name. We have transitive
functional dependency so that this structure not satisfying Third Normal Form.
• For That we will Split tables into following 2 tables:
• Employee table:
1 0001 Amit
2 0002 Divya
3 0003 Rama
• Salary Table:
0001 50000
0002 40000
0003 57000
• BCNF Normal form is higher version of third normal form.This form is used to handle
analomies which are not handled in third normal form.BCNF does not allow dependencies between
attributes that belongs to candidate keys.It drops restriction of the non key attributes from third
normal form.
Third normal form and BCNF are not same if following conditions are true:
1.The table has 2 or more candidate keys
2.At least two of candidate keys are composed of more than 1 attribute
3.The keys are not disjoint.
Example:
• Address-> {City,Street,Zip}
Key 1-> {City,Zip}
Key 2->{City,Street}
No non key attribute hence this example is of 3 NF.
{City,Street}->{zip}
{Zip}->{City}
here is dependency between attributes belonging to key.Hence this is BCNF.