Normalization of Database Tables
Normalization of Database Tables
Lecture 4
Normalization of Database
Tables
4
2
4
3
4
Figure 4.1
4
4
5
4
Conversion to 1NF
• Repeating groups must be eliminated
– Proper primary key developed
• Uniquely identifies attribute values (rows)
• Combination of PROJ_NUM and EMP_NUM
– Dependencies can be identified
• Desirable dependencies based on primary key
• Less desirable dependencies
– Partial
» based on part of composite primary key
– Transitive
» one nonprime attribute depends on another nonprime
attribute
6
4
Figure 4.4
7
4
Figure 4.3
8
4
1NF Summarized
• All key attributes defined
• No repeating groups in table
• All attributes dependent on
primary key
9
4
Conversion to 2NF
• Start with 1NF format:
• Write each key component on separate line
• Write original key on last line
• Each component is new table
• Write dependent attributes after each key
10
4
11
4
2NF Summarized
• In 1NF
• Includes no partial dependencies
– No attribute dependent on a portion of primary key
• Still possible to exhibit transitive dependency
– Attributes may be functionally dependent on
nonkey attributes
12
4
Conversion to 3NF
• Create separate table(s) to eliminate transitive
functional dependencies
13
4
3NF Summarized
• In 2NF
• Contains no transitive dependencies
14
4
Additional DB Enhancements
Figure 4.6
15
4
16
4
Figure 4.7
17
4
Decomposition of Table
Structure to Meet BCNF
Figure 4.8
18
4
Figure 4.9
19
4
20
4
Figure 4.10
21
4
Modified ERD for
Contracting Company
Figure 4.11 22
4
Final ERD for
Contracting Company
Figure 4.12
23
4
24
4
Conversion to 4NF
Figure 4.15
Set of Tables in 4NF
Figure 4.14
Multivalued Dependencies
25
4
Denormalization
• Normalization is one of many database design
goals
• Normalized table requirements
– Additional processing
– Loss of system speed
• Normalization purity is difficult to sustain due to
conflict in:
– Design efficiency
– Information requirements
– Processing
26
4
27