0% found this document useful (0 votes)
18 views29 pages

Normalization Lec4

Uploaded by

nachohaces6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views29 pages

Normalization Lec4

Uploaded by

nachohaces6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

O.

E-OGODO (MRS)
Lecture Content

 What is Normalization?
 The Purpose of Normalization.
 Database Normal Forms
 First Normal Form (1NF)
 Second Normal Form (2NF)
 Third Normal Form (3NF)
 Converting Tables to ER diagrams.
What is Normalization?

 Normalization, in the context of databases, refers to the process
of organizing data in a database efficiently.
 Database normalization is a database design principle for
organizing data in an organized and consistent way.
 Normalization is the process of reorganizing data in a database
so that it meets two basic requirements:
 There is no redundancy of data, all data is stored in only one
place.
 Data dependencies are logical, all related data items are stored
together.
 Normalization is a database design technique that reduces data
redundancy and eliminates undesirable characteristics.
 It can also be referred to as Data or Database Normalization.
Introduction

 One of the Principal objectives of relational database is to
ensure that each item of data is only held once within the
database.
 The reasons for this is simply to minimize the amount of
space used and also simplify the maintenance of data
because each time data changes, each occurrence of the
data has to be located and updated.
 In RDBMS, there is a formal procedure called
Normalization introduced by Edgar F. Codd.
 Database normalization is the process of structuring
a database usually a relational database, in order to
reduce data redundancy and improve data integrity.
More on Normalization

 Normalization can be defined as the process of decomposing a
set relations contain minimum or no redundancy. It is a formal
process of deciding which attributes should be grouped
together in a relation.
The Purpose of
Normalization

 The main purpose of database normalization is to avoid
complexities, eliminate duplicates, and organize data in a
consistent way. In normalization, the data is divided into
several tables linked together with relationships.
 Normalization is important for many reasons, but chiefly
because it allows databases to take up as little disk space
as possible, resulting in increased performance.
 It helps one to avoid redundancy and maintain the
integrity of the database. It also helps you eliminate
undesirable characteristics associated with insertion,
deletion, and updating.
The Purpose of
Normalization (2)

 Put data into a form that conforms to relational
principles e.g. single-valued columns; each relation
represents one real world entity.
 Avoid redundancy by storing each “fact” within the
database only once.
 Put data into a form that is more able to
accommodate change.
 Avoid certain difficulties in updating data.
 Facilitate the enforcement of constraints on the data.
Database Normal Forms

 1NF (First Normal Form)
 2NF (Second Normal Form)
 3NF (Third Normal Form)
 BCNF (Boyce-Codd Normal Form)
 4NF (Fourth Normal Form)
 5NF (Fifth Normal Form)
 6NF (Sixth Normal Form)
First Normal Form
(1NF)

 A relation is said to be in 1NF if each cell is single-
valued, entries in a column are of the same type and
if the rows are uniquely identified.
 Tables in 1NF must adhere to some rules:
 Each cell must contain only a single (atomic) value.
 Every column in the table must be uniquely named.
 All values in a column must pertain to the same
domain.
First Normal Form
(1NF)


First Normal Form
(1NF)

Second Normal Form
(2NF)

 A relation can be said to be in 2NF if its in 1NF and all non-key
attributes are dependent on the whole primary key and not just
a part of it.
 This definition indicates that it is applicable to relations that
have primary keys that are composite , that is , consisting of
two or more columns.
 2NF builds on 1NF by ensuring that all non-key attributes are
fully functionally dependent on the primary key. It eliminates
partial dependencies.
 A table is said to be in 2NF if it meets the following criteria:
 it’s already in 1NF
 has no partial dependency. That is, all non-key attributes are
fully dependent on a primary key.
Primary Key

 A primary is a single column value used to identify a
database record uniquely.
 It has following attributes
 A primary key cannot be NULL
 A primary key value must be unique
 The primary key values should rarely be changed
 The primary key must be given a value when a new
record is inserted.
Composite Key

 A composite key is a primary key composed of
multiple columns used to identify a record uniquely
 In our database, we have two people with the same
name Robert Phil, but they live in different places.
 Hence, we require both Full Name and Address to
identify a record uniquely. That is a composite key.
 Let’s move into second normal form 2NF
Foreign Key

 Foreign Key references the primary key of another
Table! It helps connect your Tables
 A foreign key can have a different name from its
primary key
 It ensures rows in one table have corresponding
rows in another
 Unlike the Primary key, they do not have to be
unique. Most often they aren’t
 Foreign keys can be null even though primary keys
can not
Second Normal Form
(2NF)



Tables in 2NF

Third Normal Form
(3NF)

 For a table to be in 3NF, it must be in 2NF and should also
ensure that there are no transitive dependencies.
 3NF Rules include:
 Rule 1- Be in 2NF
 Rule 2- Has no transitive functional dependencies

 A transitive dependency occurs when a non-primary key


attribute depends on another non-primary key attribute,
rather than depending directly on the primary key.
Third Normal Form
(3NF)

Third Normal Form
(3NF)

Third Normal Form
(3NF)




Summary

 Normalization is a database design technique that reduces data
redundancy and eliminates undesirable characteristics.
 One of the Principal objectives of relational database is to
ensure that each item of data is only held once within the
database.
 A relation is said to be in 1NF if each cell is single-valued,
entries in a column are of the same type and if the rows are
uniquely identified.
 A relation can be said to be in 2NF if its in 1NF and all non-key
attributes are dependent on the whole primary key and not just
a part of it.
 For a table to be in 3NF, it must be in 2NF and should also
ensure that there are no transitive dependencies.

You might also like