You are on page 1of 24

Course : ISYS6198 – Data and Information

Management
Year : 2020

Methodology – Logical Database


Design (Normalization)

Session 15&16
LEARNING OUTCOME

LO 3: Design database which includes


conceptual, logical, and physical based on
Database System Development Lifecycle
ACKNOWLEDGEMENT

These slides have been adapted


from:
- Thomas Connolly and Carolyn
Begg. 2015. Database Systems:
A Practical Approach To Design,
Implementation, and
Management. Pearson
Education. USA. ISBN:978-1-
292-06118-4 , chapter 14
- Oracle Academy, Database
Design, Section 6
LEARNING OBJECTIVES

• Define the purpose of normalization in database models


• Define the rule of First Normal Form in the normalization
process
• Convert an entity to First Normal Form if needed
• Define the rule of Second Normal Form in the
normalization process
• Apply the rule of Second Normal Form to resolve a
violation in the model
• Define the rule of Third Normal Form in the
normalization process
• Apply the rule of Third Normal Form to resolve a
violation in the model

Bina Nusantara
NORMALIZATION
Purpose of Normalization

• What happens if data is stored in more than one place


in a database?
• What if someone changes the information in one place
and not the other—how do you know which information
is correct?
• Redundancy like this causes unnecessary problems in a
database.
• Normalization is a process that is used to eliminate
these kinds of problems.
• One of your goals as a database designer is to "store
information in one place and in the best possible place“
by following the rules of normalization.

Bina Nusantara
Step 2.2 Validate relations using
normalization
• Objective : To validate the
relations in the logical data
model using normalization
• The process of normalization
takes a relation through a series
of steps to check whether the
composition of attributes in a
relation conforms or otherwise
with the rules for a given normal
relationary.wordpress.com form such as 1NF, 2NF, and 3 NF.
• Normalization produces a
flexible database design that can
be extended easily.
Bina Nusantara
First Normal Form (1NF)

• First Normal Form


requires that no multi-
valued attributes exist.
• To check for 1NF, validate
that each attribute has a
single value for each
instance of the entity.
• One code, one name, and
one address exist for the
school building, but not
one classroom.

Bina Nusantara
First Normal Form (1NF)

• First Normal Form requires


that no multi-valued
attributes exist.
• To check for 1NF, validate that
each attribute has a single
value for each instance of the
entity.
• One code, one name, and one
address exist for the school
building, but not one
classroom.
• Since many classrooms exist
in a school building,
classroom is multi-valued and
violates 1NF.
• If an attribute is multi-valued,
create an additional entity
Bina Nusantara
1NF Violations

• Examine the entities.


• Are there any multi-valued
attributes?

Bina Nusantara
1NF Solutions

• When all the attributes in an


entity are single-valued, that
entity is said to be in First
Normal Form.

Bina Nusantara
Second Normal Form (2NF)

• Second Normal Form (2NF) requires that any


non-UID attribute be dependent on (be a
property of, or a characteristic of) the entire
UID.
• Examine the entity PRODUCT SUPPLIER. The
UID is a composite UID consisting of the
supplier number and the product number.
• If one supplier supplies 5 different products,
then 5 different instances are created.
• What happens if the supplier name changes?
• Is supplier name a property of supplier
number, product number, or both?

Bina Nusantara
2NF solution
Order ERD

• What is wrong with this diagram?


• This is a violation of Second Normal Form.

Bina Nusantara
Order ERD

• The ERD is now in 2NF


• Answer: The price attribute is
misplaced.
• Item Price depends solely on
PRODUCT.

Bina Nusantara
Third Normal Form Rule

• The rule of Third Normal Form (3NF)


states that no non-UID attribute can be
dependent on another non-UID
attribute.
• Third Normal Form prohibits transitive
dependencies.
• A transitive dependency exists when
any attribute in an entity is dependent
on any other non-UID attribute in that
entity.
• Think of the kind of information you'd
like to store about your CD collection.
• Does information about the store
where you bought the CD belong in the
same entity?
• If the store address changed, you
would have to change the information
Bina Nusantara
Third Normal Form Transitive
Dependency
• The store address is dependent on
the CD number, which is the UID of
the CD entity. So this entity is in 1NF
and 2NF.
• But store address is also dependent
on store name, which is a non-UID
attribute.
• This is an example of a transitive
dependency and a violation of Third
Normal Form.
• The correctly normalized model is
shown here: create a second entity
STORE, with a relationship to CD.

Bina Nusantara
Example of Normalization

Employee

employeeID
employeeName
departmentID
departmentName
1..1

0..*
TrainingHistory

employeeID
employeeName
courseID
courseName
courseDescription
trainingDate
result
UNF
• Employee: employeeID, employeeName, departmentID,
departmentName
• TrainingHistory: employeeID, employeeName, courseID, courseName,
courseDescription, trainingDate, result
1NF
• Employee: employeeID, employeeName, departmentID,
departmentName
• TrainingHistory: employeeID, employeeName, courseID, courseName,
courseDescription, trainingDate, result

• Because there is no repeating groups. 1NF = UNF (no changes)


• There are 2 partial dependencies:
– employeeID -> employeeName,
– courseID -> courseName, courseDescription
2NF
• Employee: employeeID, employeeName, departmentID,
departmentName
• TrainingHistory: employeeID, courseID, trainingDate, result
• Course: courseID, courseName, courseDescription

• There are 1 transitive dependencies:


– departmentID -> departmentName
3NF
• Employee: employeeID, employeeName, departmentID
• TrainingHistory: employeeID, courseID, trainingDate, result
• Course: courseID, courseName, courseDescription
• Department: departmentID, departmentName
Logical
Entity Relationship Diagram
Employee Department
1..* 1..1
employeeID departmentID
employeeName departmentName
departmentID

1..1

0..*
TrainingHistory
Course
employeeID 0..* 1..1
courseID courseID
trainingDate courseName
result courseDescription
Exercise
• Apply Normalization (1-NF, 2-NF, and 3-NF) for your
group’s Logical ERD (step 2.2)
SCHOOL OF INFORMATION SYSTEMS
http://sis.binus.ac.id/
http ://www.facebook.com/schoolisbinus

SIS Binus

You might also like