Normalization Slide
Normalization Slide
Normalization
Chapter 6 - Objectives
• The purpose of normalization.
• The problems associated with redundant data.
• The identification of various types of update anomalies
such as insertion, deletion, and modification anomalies.
2
Normalization
• Main objective in developing a logical data model for
relational database systems is to create an accurate
representation of the data, its relationships, and
constraints.
• To achieve this objective, we must identify a suitable set
of relations.
• A technique for producing a set of relations with
desirable properties, given the data requirements of an
enterprise.
• Developed by E.F. Codd (1972).
• Often performed as a series of tests on a relation to
determine whether it satisfies or violates the
requirements of a given normal form. 4
Normalization
• Three most commonly used normal forms are
first (1NF), second (2NF), third (3NF)
6
Data Redundancy
7
Data Redundancy
• Staff_Branch relation has redundant data; the
details of a branch are repeated for every
member of staff.
8
Update Anomalies
• Relations that contain redundant information may
potentially suffer from update anomalies.
• Types of update anomalies include: Insertion, Deletion,
Modification
9
INSERTION ANOMALY
DELETION ANOMALY
MODIFICATION ANOMALY
Unnormalized Form (UNF)
• A table that contains one or more repeating
groups.
• To create an unnormalized table
– Transform the data from the information source
(e.g. form) into table format with columns and rows.
14
UNF to 1NF
• Nominate an attribute or group of attributes to act
as the key for the unnormalized table.
• Identify the repeating group(s) in the
unnormalized table which repeats for the key
attribute(s).
• Remove the repeating group by
– Entering appropriate data into the empty columns of
rows containing the repeating data (‘flattening’ the
table).
Or by
– Placing the repeating data along with a copy of the
original key attribute(s) into a separate relation.15
Example 1 - Normalization Report
16
1NF -
REMOVE REPEATING GROUP
STUDENT(SID,Name,Tel,Address,Email, ExamOfficerId,OfficerName,ext)
17
1NF to 2NF
• Identify the primary key for the 1NF relation.
21
2NF -
REMOVE FUNCTIONAL DEPENDENCY
STUDENT(SID,Name,Tel,Address,Email, ExamOfficerId,OfficerName,ext)
STD_SUB (SID,SubCode,Mark,Grade,Remark)
SUBJECT (SubCode,Description,CreditHR)
17
2NF to 3NF
• Identify the primary key in the 2NF relation.
24
3NF -
REMOVE TRANSITIVE DEPENDENCY
STUDENT(SID,Name,Tel,Address,Email)
OFFICER(ExamOfficerId,OfficerName,ext)
STD_SUB (SID,SubCode,Description,CreditHR,Mark,Grade,
Remark)
SUBJECT (SubCode,Desc,CreditHR) 17