Professional Documents
Culture Documents
Normalization
Normalization
Topic Objectives
This topic discusses Normalization. At the end of the topic, you will
be able to:
define Normalization
In this topic, you will see how to systematically assign each attribute
to the proper entity.
Normalization
6
Purpose of Normalization
• The benefits of using a database that has a suitable set
of relations is that the database will be:
– easier for the user to access and maintain the data;
– take up minimal storage space on the computer.
7
Data Redundancy and Update
Anomalies
• Major aim of relational database design
is to group attributes into relations to
minimize data redundancy.
8
Data Redundancy and Update
Anomalies
• Potential benefits for implemented
database include:
– Updates to the data stored in the database
are achieved with a minimal number of
operations thus reducing the opportunities
for data inconsistencies.
– Reduction in the file storage space required
by the base relations thus minimizing costs.
9
Normalizing Data Model
12
Pearson Education © 2009
First Normal Form (1NF)
• A relation in which the intersection of
each row and column contains one and
only one value.
13
Pearson Education © 2009
UNF to 1NF
• Nominate an attribute or group of
attributes to act as the key for the
unnormalized table.
14
Pearson Education © 2009
UNF to 1NF
• 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
Pearson Education © 2009
Normalizing Data Model
Here are some examples of attributes that probably meet this first
rule:
CUSTOMER FILM PROJECT PART
number title start date name
first name studio
last name
The amount of a payment is not a fact that occurs once, for all time,
per customer. It is misplaced; there must be another entity
representing payments, where each row has a payment amount. The
same is true for the attributes. They belong to some other entity.
B. manager number
C. parent department
D. date of hire
The wedding date and location, the person who officiated, the
photographer, etc., are not facts about the husband alone, or the wife
alone, but about the combination of them. Likewise, the time and
location of a course session are not about the course alone, but about
about a course and its specific session.
Here are some examples of attributes which are facts about only part
of the entity’s UID:
The date of birth should probably be two separate attributes, one for
each spouse. Then it would be completely apparent that those
attributes belonged to a different entity.
The title and description of a course are very likely the same for
every session. In this case, these attributes belong to the COURSE
entity, not COURSE SESSION.
The number of seats is a fact about the classroom, but not about
the UID of the COURSE SESSION entity. If there is not another
entity for CLASSROOM, then there should be, and “number of
seats” should be one of its attributes.
This rule forbids the multi-valued relation between the UID and
attribute.
This rule forbids the multi-valued relation between the UID and
attribute.
EXAMPLE;
CUSTOMER
# customer id
* first name
* surname
* sponsor
EXAMPLE;
CUSTOMER
# customer id
* first name
* surname What if a CUSTOMER has
* sponsor
more than one SPONSOR.
EXAMPLE;
CUSTOMER SPONSOR
sponsored
# customer id # sponsor id
* first name by
* name
* surname
the
* sponsor
sponsor
of
PAYMENT CUSTOMER
* amount # customer id
* first name
* surname
* sponsor
CUSTOMER_SPONSOR
1234 1
Multi-valued relation 1234 2
(even if the occurrence 1245 1
is few times) is not allowed.
1245 3
cetinerg@itu.edu.tr Assoc.Prof.Dr.B.Gültekin Çetiner
Normalizing Data Model
DEFENDANT A. address
# defendant number
first name B. Surname
last name
address C. first name
D. None
You can ask a question like following for 5th Normal Form.
Has this entity got at least 3 candidate UIDs and can we construct
different entities for each candidate UID without data
redundancy (repetition).
EMPLOYEE
? badge number
? social security number
? tax number
first name
surname
date of birth
EMPLOYEE
??????? ? badge number ???????
# badge number ? social security number # tax number
??? ? tax number ???
first name
surname
date of birth
???????
# social security number
???
???
Assoc.Prof.Dr.B.Gültekin Çetiner
Normalizing Data Model
Summary of Normalization:
If each attribute of every entity passes this test, then the E-R
Diagram is fully normalized.
Do not exaggerate!