Professional Documents
Culture Documents
LECTURE 5
Normalization
Normalization is the process of efficiently organizing data in a database. There are
two goals of the normalization process:
■ Eliminating redundant data (for example, storing the same data in more than one
table)
■ 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.
Problem without Normalization
■ Without Normalization, it becomes difficult to handle and update the database,
without facing data loss.
■ Insertion, Updation and Deletion Anamolies are very frequent if Database is not
normalized.
Data redundancy
Database Anomalies
Database anomalies are the problems in relations that occur due to redundancy
in the relations. These anomalies affect the process of inserting, deleting and
modifying data in the relations.
Some important data may be lost if a relation is updated that contains database
anomalies. It is important to remove these anomalies in order t perform
different processing on the relations without any problem.
Anomalies
Example: consider the table below
Anomalies cont’d
■ Update anomaly: to update the a new branch address of B003 from 163
main, st Glasgow to 164 main, st Glasgow all the rows have to be changed
that otherwise there will be data inconsistency
■ Deletion anomaly:-if we delete the tuple for staff number SA9 (Mary Howe)
from the StaffBranch relation, the details relating to branch number B007
are lost from the database
Normalization rule are divided into
following normal form.
■ First Normal Form
■ Second Normal Form
■ Third normal form
First Normal Form (1NF)
First normal form (1NF) sets the very basic rules for an organized database:
■ Eliminate duplicative columns from the same table.
■ A column should hold values of the same type
■ Each column should have a unique name
Second Normal Form (2NF)
Second normal form (2NF) further addresses the concept of removing
duplicative data:
■ 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.
Third normal form