CIS340 Lecture 15-3
CIS340 Lecture 15-3
Normalization Definition
Normal From
Definitions of Keys and Attributes
Participating in Keys
First Normal Form
Second Normal Form 2NF
Third Normal Form 3NF
General Definition of 2NF (For Multiple Keys)
General Definition of 3NF (For Multiple Keys)
Boyce-Codd Normal Form (BCNF)
Normalization
3
Chapter 10-6
In general, it is recommended that we
Definitions of Keys and
Attributes Participating in
7
Keys
A superkey of a relation schema
R = {A1, A2, ...., An}
is a set of attributes S subset-of R with the
property that
no two tuples t1 and t2 in any legal relation state r
of R will have t1[S] = t2[S]
Disallows
composite attributes
multivalued attributes
nested relations
attributes whose values for an individual tuple are non-
atomic
Chapter 10-9
1NF Example (1)
10
DEPARTMERNT
DNAME DNUMBER DMGRSSN DLOCATIO
NS
We assume that each department can
have a number of locations
This relation is not in 1NF, because
DLOCATION is not an atomic attribute
There are two ways we can look at the
DLOCATIONS attribute
Chapter 10-10
1NF Example (1)
11
Chapter 10-11
1NF Example (1)
12
Chapter 10-12
1NF Example (1)
13
Dlocation1=“Bellair” OR Dlocation2=“Bellair” OR
Dlocation3=“Bellair”
1NF Example (1)
17
Example
PERSON(SS#, {CAR_LIC}, {PHONE#})
This relation represents the fact that a person has
multiple cars and multiple phones
Chapter 10-22
Second Normal Form 2NF
23
Chapter 10-23
Second Normal Form 2NF
24
Chapter 10-25
Third Normal Form 3NF
26
Chapter 10-26
Third Normal Form 3NF
27
Chapter 10-27
Third Normal Form 3NF
28
The test for 2NF involves testing for FDs whose left-hand side
attributes are part of the primary key.
Chapter 10-33
3NF Example
34
Un-Normalized Form
R2A(ID, VisitDate,
PNO )
2NF R2B(PNO,
PName )
R2A(ID, VisitDate,
3NF PNO )
R2B(PNO,
PName )