Documente Academic
Documente Profesional
Documente Cultură
Objectives
2
Purpose of
Normalization
Purpose of
Normalization
The benefits of using a database that has
a suitable set of relations is that the
database will be:
How Normalization
Supports Database Design
Design 1
Design 2
If Design 2 is used,
to enter the details of new staff with branch no. B007
would require that the correct details of branch no. B007
is entered so that it will be consistent with values for
branch no. B007 in other tuples. But if Design 1 relation
is used, they do not suffer this potential inconsistency
to insert a new branch that has no member, other
attributes would consist null values this can violate
primary key req.
10
11
12
13
14
Modification anomalies
Insertion anomalies
Deletion anomalies
15
The Normalization
Process
Works through a series of stages called
normal forms:
16
The Process of
Normalization
17
Conversion to First
Normal
Form
Repeating group
18
Conversion to
1NF(continued)
Step 1: Eliminate the Repeating Groups
Conversion to
1NF(continued)
19
20
Conversion to
1NF(continued)
21
Conversion to
1NF(continued)
22
Conversion to
1NF(continued)
23
Conversion to
1NF(continued)
24
Conversion to
1NF(continued)
25
Conversion to
1NF(continued)
Result of 1NF
26
Relation name
Primary/composite
key
All attributes
1NF
27
28
Conversion to Second
Normal Form
29
Conversion to
2NF(continued)
Step 1: Write Each Key Component on a
Separate Line
Write each key component on separate line,
then write original (composite) key on last line
PROJ_NUM
EMP_NUM
PROJ_NUM
EMP_NUM
Conversion to 2NF
(continued)
30
31
Conversion to
2NF(continued)
If at the end, there are relations with
Another technique to
convert to 2NF
32
Result of 2NF
33
34
Conversion to
2NF(continued)
35
Conversion to Third
Normal Form
3NF removes transitive dependency
Step 1: Write the previous 2NF relations
Step 2: For each transitive dependency (nonkey dependents on another non-key), create
a new relation with determinant as key.
Step 3: In the original 2NF, delete the
dependents. Make the key into foreign key
(circle/italic/colored).
Result of 3NF
36
Conversion to 3NF
(continued)
37
staffNo
38
Sample Exercise
1
branchNo
branchAddress
S4552
B001
S4555
B004
S4612
S4612
name
position
hoursPerWeek
Ellen London
Assistant
16
Ellen Layman
Assistant
B002
Dave Sinclair
Clerk
14
B004
Dave Sinclair
Clerk
10
Examine the table shown above. This table represents the hours worked per week
for temporary staff at each branch of a company.
1.
2.
Using the functional dependencies identified in part (2), describe and illustrate
the process of normalization by converting the table to Third Normal Form (3NF)
relations. Identify the primary and foreign keys in your 3NF relations.
39
Sample Exercise
2
Sketch a table with the attributes of the above schema as column headers.
Populate the table with 10 records of data.
2.
Identify the primary key and the functional dependencies represented by the
data shown in the table.
3.
Using the functional dependencies identified in part (2), describe and illustrate
the process of normalization by converting the table to Third Normal Form (3NF)
relations. Identify the primary and foreign keys in your 3NF relations.
40
Sample Exercise
3
CTR G
M
Y
RP A
T
C
H
ID
DAT
E
TIM
E
STADIU LOC W L
M
GF
GA PT
Learning Outcomes
41
References
42