Professional Documents
Culture Documents
Database Normalization
a technique for designing relational
database tables to minimize duplication of
information and, in so doing, to safeguard
the database against certain types of
logical or structural problems, namely
data anomalies.
Database Normalization
Example, when multiple instances of a
given piece of information occur in a table,
the possibility exists that these instances
will not be kept consistent when the data
within the table is updated, leading to a
loss of data integrity.
Database Normalization
A table that is sufficiently normalized is
less vulnerable to problems of this kind,
because its structure reflects the basic
assumptions for when multiple instances
of the same information should be
represented by a single instance only.
Why do we need to normalize?
To avoid anomalies
Why do we need to normalize?
Higher degrees of normalization typically involve
more tables and create the need for a larger
number of joins, which can reduce performance.
Accordingly, more highly normalized tables are
typically used in database applications involving
many isolated transactions (e.g. an Automated
teller machine), while less normalized tables tend
to be used in database applications that do not
need to map complex relationships between data
entities and data attributes (e.g. a reporting
application, or a full-text search application).
Normal Forms
1NF,2NF,3NF,BCNF,4NF,5NF
Database theory describes a table's
degree of normalization in terms of normal
forms of successively higher degrees of
strictness.
A table in third normal form (3NF), for
example, is consequently in second
normal form (2NF) as well; but the
reverse is not always the case.
Anomalies: Problems addressed by
Normalization
If the proper normal forms aren't followed,
various undesirable side effects can occur
in a database
These side effects are commonly referred
to as anomalies.
Insertion Anomalies
Deletion Anomalies
Update Anomalies
Insertion Anomaly
This occurs when you can’t add row into a
table
Department Dept_Address
Research 2 Ferman St.
MIS 3 Gauss Lane
HR 6 Wiles Place
Boyce-Codd Normal Form (BCNF)
An extension of 3NF for the special case
where:
There are at least 2 candidate keys in the table
All the candidate keys are composite keys
There is an overlapping column in the
candidate keys.
A table to be in BCNF, it must be
3NF
All of its columns in all its candidate keys must
be functionally independent.
Violation of the BCNF
EmployeeID Extension Month Overtime_Hours
8934 9089 January 2
8934 9089 February 1.5
8934 9089 March 2
7623 8607 January 0
7623 8607 February 3
7623 8607 March 3
4503 3869 January 2
4503 3869 February 8
4503 3869 March 0
Fourth Normal Form (4NF)
It is in the 3NF
There is only one multi-valued
dependency per table.
A multi-valued dependency is a constraint
according to which the presence of certain
rows in a table implies the presence of certain
other rows
Multi-valued dependency occurs when
there is many-to-many relationship
between two columns in a table.
Violation of the 4NF
AuthorID BookTitle Editor
Smith023 Monkeys are from Asteriod Lisa
Smith023 How to Exercise Catherine
Smith023 How to Exercise John
Williams153 Monkeys are from Asteriod John
Williams153 AP Programming Elaine
Johnson823 Dogs are from Hale-Bopp Lisa
Johnson823 Monkeys are from Asteriod Silvia