DB Lec 5+6 Normalization
DB Lec 5+6 Normalization
Normalization
Normalization
2
Well-Structured Relations
3
Anomalies
An error or inconsistency that may result when a user
attempts to update a table that contains redundant data.
The three types of anomalies are:
Insertion Anomaly–adding new rows forces user to create duplicate
data
Deletion Anomaly–deleting rows may cause a loss of data that
would be needed for other future rows
Modification Anomaly–changing data in a row forces changes to
other rows because of duplication
Example
5
Anomalies in this Table
Insertion–can’t enter a new employee without having the
9
Functional Dependencies and Keys
Functional Dependency: The value of one attribute (the determinant)
determines the value of another attribute
Candidate Key:
10
First Normal Form
There are no repeating groups in the relation (thus, there is
the table).
11
Table with multivalued attributes, not in 1st normal form
12
Convert to 1NF
Remove repeating groups
Convert to 1NF
There are four determinants in INVOICE, and their
Customer_Address
several records
17
Second Normal Form
1NF PLUS every non-key attribute is fully functionally
18
Convert To 2NF
Partial Functional Dependency
primary key.
Convert To 2NF
Functional Dependency Diagram
Convert To 2NF
Steps to Convert relation from 1NF to 2NF
24
Convert to 3NF
Transitive Dependency
key attributes.
Convert to 3NF
Functional Dependency Diagram
Convert to 3NF
Steps to convert relation from 2NF to 3NF
For each non key attribute (or set of attributes) that is determinant in
the old relation to serve as a foreign key that allow you to associate
the two relations.
Convert to 3NF
Functional Dependency Diagram