Data Normalization
Data Normalization
of
Database Tables
Objectives
2
Database Tables and Normalization
• Normalization
• Process for evaluating and correcting table
structures to minimize data redundancies
• Reduces data anomalies
• Series of stages called normal forms:
• First normal form (1NF)
• Second normal form (2NF)
• Third normal form (3NF)
3
Database Tables and Normalization (cont’d.)
Normalization (continued)
• 2NF is better than 1NF; 3NF is better than 2NF
• For most business database design purposes,
3NF is as high as needed in normalization
• Highest level of normalization is not always most
desirable
Denormalization produces a lower normal form
• Increased performance but greater data
redundancy
4
The Need for Normalization
5
6
7
The Need for Normalization (cont’d.)
Structure of data set in Figure 6.1 does not handle
data very well
Table structure appears to work; report is
generated with ease
Report may yield different results depending on
what data anomaly has occurred
Relational database environment is suited to help
designer avoid data integrity problems
8
The Normalization Process
9
10
The Normalization Process (cont’d.)
• Objective of normalization is to ensure that all
tables are in at least 3NF
• Higher forms are not likely to be encountered in
business environment
• Normalization works one relation at a time
• Progressively breaks table into new set of relations
based on identified dependencies
11
12
Conversion to First Normal Form
• Repeating group
• Group of multiple entries of same type can exist
for any single key attribute occurrence
• Relational table must not contain repeating groups
• Normalizing table structure will reduce data
redundancies
• Normalization is three-step procedure
13
Conversion to First Normal Form (cont’d.)
• Step 1: Eliminate the Repeating Groups
• Eliminate nulls: each repeating group attribute
contains an appropriate data value
• Step 2: Identify the Primary Key
• Must uniquely identify attribute value
• New key must be composed
• Step 3: Identify All Dependencies
• Dependencies are depicted with a diagram
14
15
Conversion to First Normal Form (cont’d.)
• Dependency diagram:
• Depicts all dependencies found within given table
structure
• Helpful in getting bird’s-eye view of all
relationships among table’s attributes
• Makes it less likely that you will overlook an
important dependency
16
17
Conversion to First Normal Form (cont’d.)
• It is in 1NF and
21
Conversion to Third Normal Form
• Step 1: Make New Tables to Eliminate Transitive
Dependencies
• For every transitive dependency, write its
determinant as PK for new table
• Determinant: any attribute whose value
determines other values within a row
22
Conversion to Third Normal Form (cont’d.)
23
24
Conversion to Third Normal Form (cont’d.)
25
Improving the Design
26
Improving the Design (cont’d.)
27
Improving the Design (cont’d.)
28
29
Normalization and Database Design
35
Normalization and Database Design (cont’d.)
• ER diagram
• Identify relevant entities, their attributes, and their
relationships
• Identify additional entities and attributes
• Normalization procedures
• Focus on characteristics of specific entities
• Micro view of entities within ER diagram
• Difficult to separate normalization process from ER
modeling process
36
37
38
39
40
41
Summary
46
Summary (cont’d.)
47