0% found this document useful (0 votes)
269 views

Normalization

1) Normalization is a process of organizing data to eliminate anomalies like data redundancy, insertion anomalies, update anomalies, and deletion anomalies. 2) It involves decomposing large tables into smaller tables to improve data structure without losing information. 3) Normalization aims to ensure that each attribute depends on the primary key, and that no attribute is transitively dependent on another. This is tested through normal forms like 1NF, 2NF, 3NF and BCNF.
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)
269 views

Normalization

1) Normalization is a process of organizing data to eliminate anomalies like data redundancy, insertion anomalies, update anomalies, and deletion anomalies. 2) It involves decomposing large tables into smaller tables to improve data structure without losing information. 3) Normalization aims to ensure that each attribute depends on the primary key, and that no attribute is transitively dependent on another. This is tested through normal forms like 1NF, 2NF, 3NF and BCNF.
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/ 33

NORMALIZATION

1NF,2NF,3NF,4NF

2018 Prepared by: Angelica Jones Jupia


NORMALIZATION
 Is a process of organizing the data in database to
avoid data redundancy, insertion anomaly, update
anomaly and deletion anomaly.
 Is the process of decomposing large, inefficiently
structured tables into smaller, more efficiently
structured tables without losing any data in the
process.
NORMALIZATION

Normalization supports
the proposition that a
well-defined database
contains no duplicate
data and keeps
redundant data to an
absolute minimum.
THE NEED FOR NORMALIZATION
 Database designers commonly use normalization in
two situations.
 The database designer can use normalization to
analyze the relationships among the attributes within
each entity and determine if the structure can be
improved through normalization.
 The database designer can use the normalization
process to improve the existing data structure and
create an appropriate database design.
NORMALIZATION
 Decomposing improperly structured table is not an
arbitrary process. It is instead a methodical process
you perform by testing each table against a set of
Normal Forms.
 Normal Forms: is an algorithm you use to test the
structure of a table.
MODIFICATION ANOMALIES
 A constrain placed upon the ability to modify data
in the table that is imposed by the table’s structure.
 There are three types of Modification Anomalies:
 InsertAnomaly
 Deletion Anomaly

 Update Anomaly
MODIFICATION ANOMALIES
Insert Anomaly
 Exist in a table when there is an unnecessary or
unreasonable constraint placed upon the task id
adding a new record, or when adding a new
record will cause unnecessary or unreasonable data
redundancy.
MODIFICATION ANOMALIES
Insert Anomaly
Cust Item Shipping Newsletter Supplier Supplier Price
Name Address Phone
Alan Xbox one 35 Palm St. Xbox News Microsoft (800) Buy- 250
Smith Miami XBOX
Because data on Customer
Roger Play station 4 47 Campus Play Sony (800) Buy- 300
Banks
and Item are
Rd, Boston station
being stored in Sony
the same table,News you cannot
Evan Xbox one, PS enter
28 a data
Rock Av, for aWholesale
Xbox news, new Item Toll Free 450
Wilson Vita until you have
Denver Play at least one
customer who avail the new
station
news
item.
Alan Play station 4 47 Campus Play Sony (800) Buy- 300
Smith Rd, Boston station Sony
News
MODIFICATION ANOMALIES
Deletion Anomaly
 Exists when deleting a record would remove data
not intended for deletion.
MODIFICATION ANOMALIES
Deletion Anomaly
Cust Item Shipping Newsletter Supplier Supplier Price
Name Address Phone
Alan Xbox one 35 Palm St. Xbox News Microsoft (800) Buy- 250
Smith IfMiami
you delete item “Play XBOX
Roger station
Play station 4 47 Campus4”, you
Play have Sony
the (800) Buy- 300
Banks possibility
Rd, Boston of deleting a
station largeSony
News
number of records. You will
Evan Xbox one, PS 28 Rock Av, Xbox news, Wholesale Toll Free 450
be deleting Roger Banks and
Wilson Vita Denver Play
Alan Smithstation
records.
news
Alan Play station 4 47 Campus Play Sony (800) Buy- 300
Smith Rd, Boston station Sony
News
MODIFICATION ANOMALIES
Update Anomaly
 Exists when modifying a specific value necessitates
the same modification in other records or tables.
MODIFICATION ANOMALIES
Update Anomaly
Cust Item Shipping Newsletter Supplier Supplier Price
Name Address Phone
Alan Xbox one 35 Palm St. Xbox News Microsoft (800) Buy- 250
Smith Miami XBOX
Roger You
Playhave
stationto4 make changes
47 Campus Playto Sony (800) Buy- 300
Banks two records ifRd, the supplier
Boston station Sony
“Sony” phone number News
Evan decided
Xbox one,to
PSchange their
28 Rock Av, Xbox news, Wholesale Toll Free 450
Wilsonname.Vita Denver Play
station
news
Alan Play station 4 47 Campus Play Sony (800) Buy- 300
Smith Rd, Boston station Sony
News
DEPENDENCY:
The Good, the Bad and the Ugly
 Dependency Theory is the field of study comprising
Normalization theory, dependency principles, and
other related choices.
 Functional Dependency – the Good
 Transitive Dependency – the Bad

 Multi-valued Dependency – the Ugly


DEPENDENCY:
FUNCTIONAL DEPENDENCY(FD) - The Good

 Exists between two fields, A an B, when a distinct


value of A is directly associated with a distinct
value of B.
 A FD is diagrammed as A B and can be read
equivalently as either of the following statements.
 The value of A determines the value of B.
 The value of B is functionally dependent on the value of B.
Note: the field on the left hand side is called determinant and
the field on the field on the right hand side is called the
dependent.
DEPENDENCY:
FUNCTIONAL DEPENDENCY(FD) - The Good
Item Supplier Supplier Phone Price

Xbox one Microsoft (800) Buy-XBOX 250

Play station 4 Sony (800) Buy- Sony 300

PS Vita Sony (800) Buy- Sony 200

Item determines the values of


other fields.
•Supplier determines by Item
DEPENDENCY:
TRANSITIVE DEPENDENCY(TD) - The Bad
 Exists between as A and C because a distinct value
of A is indirectly associated with distinct value of C
by way of B.
A determines the value of B.
 B determines the value of C.
 Therefore, A transitively determines the value of C.

 A TD diagrammed as A C and can be read as


equivalently as either the following statements.
 The value of A transitively determines the value of C(via B).
 The value of c transitively dependent on the value of A (via
B).
DEPENDENCY:
TRANSITIVE DEPENDENCY(TD) - The Bad
Item Supplier Supplier Phone Price

Xbox one Microsoft (800) Buy-XBOX 250

Play station 4 Sony (800) Buy- Sony 300

PS Vita Sony (800) Buy- Sony 200

Item determines the values of other fields.


•Supplier determines by Item
•Supplier phone determines by the
Supplier.
•Therefore, Item transitively determines
the value of Supplier Phone
DEPENDENCY:
MULTI-VALUED DEPENDENCY(MVD) - The Ugly

 Exists between two fields, A and B, when a distinct


value of A is directly associated with two or more
values of B.
 A MVD is diagrammed as A B and can be
read equivalently as either of the following
statements.
 The value of A determines multiple values of B.
 Multiple values of B are functionally dependent on the value
of A.
DEPENDENCY:
MULTI-VALUED DEPENDENCY(MVD) - The Ugly
Cust ID Cust Name Shipping Address Newsletter

At_smith Alan Smith 35 Palm St. Miami Xbox News

Roger25 Roger Banks 47 Campus Rd, Play station News


Boston
Wilson44 Evan Wilson 28 Rock Av, Denver Xbox news

Wilson44 Evan Wilson 28 Rock Av, Denver Play station news

Am_smith Alan Smith 47 Campus Rd, Play station News


Boston
A single valued of Cust ID is
associated with one or more
subscription of News letter.
NORMALIZATION
Cust Item Shipping Newsletter Supplier Supplier Price
Name Address Phone
Alan Xbox one 35 Palm St. Xbox News Microsoft (800) Buy- 250
Smith Miami XBOX
Roger Play station 4 47 Campus Play Sony (800) Buy- 300
Banks Rd, Boston station Sony
News
Evan Xbox one, PS 28 Rock Av, Xbox news, Wholesale Toll Free 450
Wilson Vita Denver Play
station
news
Alan Play station 4 47 Campus Play Sony (800) Buy- 300
Smith Rd, Boston station Sony
News
FIRST NORMAL FORM(1NF)
 This rule defines that all the attributes in a relation
must have atomic domains.
 Each cell must be Single valued.
 Rows uniquely identified
NORMALIZATION
Cust Item Shipping Newsletter Supplier Supplier Price
Name Address Phone
Alan Xbox one 35 Palm St. Xbox News Microsoft (800) Buy- 250
Smith Miami XBOX
Roger Play station 4 47 Campus Play Sony (800) Buy- 300
Banks Rd, Boston station Sony
News
Evan Xbox one, PS 28 Rock Av, Xbox news, Wholesale Toll Free 450
Wilson Vita Denver Play
station
news
Alan Play station 4 47 Campus Play Sony (800) Buy- 300
Smith Rd, Boston station Sony
News
FIRST NORMAL FORM(1NF)

Cust ID Cust Item Shipping Newsletter Supplier Supplier Price


Name Address Phone
At_smith Alan Xbox one 35 Palm St. Xbox News Microsof (800) Buy- 250
Smith Miami t XBOX
Roger25 Roger Play 47 Campus Play station Sony (800) Buy- 300
Banks station 4 Rd, Boston News Sony
Wilson44 Evan Xbox one 28 Rock Av, Xbox news Microsof (800) Buy- 250
Wilson Denver t XBOX
Wilson44 Evan PS Vita 28 Rock Av, Play station Sony (800) Buy- 200
Wilson Denver news Sony
Am_smith Alan Play 47 Campus Play station Sony (800) Buy- 300
Smith station 4 Rd, Boston News Sony
SECOND NORMAL FORM(2NF)
 Before we learn about the second normal form, we
need to understand the following:
 Prime attribute − An attribute, which is a part of the
prime-key, is known as a prime attribute.
 Non-prime attribute − An attribute, which is not a part
of the prime-key, is said to be a non-prime attribute.
 Every non-prime attribute should be fully
functionally dependent on prime key attribute.
 All attributes (Non-Key Columns) dependents on the
key.
FIRST NORMAL FORM(1NF)

Cust ID Cust Item Shipping Newsletter Supplier Supplier Price


Name Address Phone
At_smith Alan Xbox one 35 Palm St. Xbox News Microsof (800) Buy- 250
Smith Miami t XBOX
Roger25 Roger Play 47 Campus Play station Sony (800) Buy- 300
Banks station 4 Rd, Boston News Sony
Wilson44 Evan Xbox one 28 Rock Av, Xbox news Microsof (800) Buy- 250
Wilson Denver t XBOX
Wilson44 Evan PS Vita 28 Rock Av, Play station Sony (800) Buy- 200
Wilson Denver news Sony
Am_smith Alan Play 47 Campus Play station Sony (800) Buy- 300
Smith station 4 Rd, Boston News Sony
SECOND NORMAL FORM(2NF)
Cust ID Cust Name Shipping Address Newsletter

At_smith Alan Smith 35 Palm St. Miami Xbox News

Roger25 Roger Banks 47 Campus Rd, Play station News


Boston
Wilson44 Evan Wilson 28 Rock Av, Denver Xbox news

Wilson44 Evan Wilson 28 Rock Av, Denver Play station news

Am_smith Alan Smith 47 Campus Rd, Play station News


Boston

Item Supplier Supplier Phone Price Cust ID Item


At_smith Xbox one
Xbox one Microsoft (800) Buy-XBOX 250
Roger25 Play station 4
Playstation 4 Sony (800) Buy- Sony 300 Wilson44 PS Vita
Wilson44 Xbox one
PS Vita Sony (800) Buy- Sony 200
Am_smith Play station 4
THIRD NORMAL FORM(3NF)
 For a relation to be in Third Normal Form, it must be
in Second Normal form and the following must
satisfy:
 No non-prime attribute is transitively dependent on prime
key attribute.
 All fields(column) can be determined only by the
key in the table and no other column.
SECOND NORMAL FORM(2NF)
Cust ID Cust Name Shipping Address Newsletter

At_smith Alan Smith 35 Palm St. Miami Xbox News

Roger25 Roger Banks 47 Campus Rd, Play station News


Boston
Wilson44 Evan Wilson 28 Rock Av, Denver Xbox news

Wilson44 Evan Wilson 28 Rock Av, Denver Play station news

Am_smith Alan Smith 47 Campus Rd, Play station News


Boston

Item Supplier Supplier Phone Price Cust ID Item


At_smith Xbox one
Xbox one Microsoft (800) Buy-XBOX 250
Roger25 Play station 4
Playstation 4 Sony (800) Buy- Sony 300 Wilson44 PS Vita
Wilson44 Xbox one
PS Vita Sony (800) Buy- Sony 200
Am_smith Play station 4
THIRD NORMAL FORM(3NF)
Cust ID Cust Name Shipping Newsletter
Address
At_smith Alan Smith 35 Palm St. Xbox News Cust ID Item
Miami At_smith Xbox one
Roger25 Roger Banks 47 Campus Rd, Play station Roger25 Play station 4
Boston News Wilson44 PS Vita
Wilson44 Evan Wilson 28 Rock Av, Xbox news Wilson44 Xbox one
Denver Am_smith Play station 4
Wilson44 Evan Wilson 28 Rock Av, Play station
Denver news
Am_smith Alan Smith 47 Campus Rd, Play station
Boston News

Item Supplier Price


Xbox one Microsoft 250 Supplier Supplier Phone
Play station 4 Sony 300 Microsoft (800) Buy-XBOX
PS Vita Sony 200 Sony (800) Buy- Sony
FOURTH NORMAL FORM(4NF)
 Ensure that a tables does not contain any multi-
valued dependencies, and that it describes one and
only one subject.
THIRD NORMAL FORM(3NF)
Cust ID Cust Name Shipping Newsletter
Address
At_smith Alan Smith 35 Palm St. Xbox News Cust ID Item
Miami At_smith Xbox one
Roger25 Roger Banks 47 Campus Rd, Play station Roger25 Play station 4
Boston News Wilson44 PS Vita
Wilson44 Evan Wilson 28 Rock Av, Xbox news Wilson44 Xbox one
Denver Am_smith Play station 4
Wilson44 Evan Wilson 28 Rock Av, Play station
Denver news
Am_smith Alan Smith 47 Campus Rd, Play station
Boston News

Item Supplier Price


Xbox one Microsoft 250 Supplier Supplier Phone
Play station 4 Sony 300 Microsoft (800) Buy-XBOX
PS Vita Sony 200 Sony (800) Buy- Sony
FOURTH NORMAL FORM(4NF)
Cust ID Cust Name Shipping Address Cust ID Item
At_smith Alan Smith 35 Palm St. Miami At_smith Xbox one
Roger25 Play station 4
Roger25 Roger Banks 47 Campus Rd, Boston
Wilson44 PS Vita
Wilson44 Evan Wilson 28 Rock Av, Denver
Wilson44 Xbox one
Am_smith Alan Smith 47 Campus Rd, Boston
Am_smith Play station 4

Supplier Supplier Phone Cust ID Newsletter


Microsoft (800) Buy-XBOX At_smith Xbox News
Sony (800) Buy- Sony Roger25 Play station News
Item Supplier Price Wilson44 Xbox news
Xbox one Microsoft 250 Wilson44 Play station news
Play station 4 Sony 300 Am_smith Play station News
PS Vita Sony 200
THE END...
THANK YOU FOR LISTENING...

You might also like