Professional Documents
Culture Documents
NORMALIZATION
PART 2
!
NORMALIZATION
!
!
• Functional dependencies!
!
Functional
NORMALIZATION
Dependency
Functional Dependency
• Functional dependency is a constraint between 2 attributes or 2 sets of attributes
• The
determinant
of
a
functional
dependency
refers
to
the
attribute
or
group
of
attributes
on
the
left-‐hand
side
of
the
arrow.
A B
• B
is
functionally
dependent
on
attribute
A
• A
uniquely
determines
the
value
of
B
Functional
NORMALIZATION
Dependency
EMPLOYEE_1
EmpID Name DeptName Salary
100 Simpson Marketing 48000
140 Susan Accounting 52000
110 Lorenzo Info
System 43000
190 Allen Finance 55000
150 Dave Marketing 42000
EMPLOYEE_2
EmpID Course_Tittle Name DeptName Salary DateComplete Neither
EmpID
nor
100 SPSS Simpson Marketing 48000
d
6/10/2014
CourseTitle
uniquely
identifies
a
140 Surveys Susan Accounting 52000 5/5/2014 row
in
this
relation
110 Tax
Acc Lorenzo Info
System 43000 6/2/2014 and
therefore
190 C++ Allen Finance 55000 15/8/2014
cannot
by
itself
be
a
candidate
key.
150 Java Dave Marketing 42000 28/1/2015
Transitive Dependency
The Proses
Product
Product
ID Finish Quantity Unit
Price Extended
Price
Description
Total
$
6,250.00
The proses of
NORMALIZATION
normalization
UNF to 1NF
UNF to 1NF
Natural
P63
Sofa
Maple
$
125.00 4
First Normal
NORMALIZATION
Form
UNF to 1NF
1006 10/24/2010 C102 Abu
Suffian 678
Hill
Street,
P55
Cherry
$
800.00
Writer’s
Desk 5
Marrickville
1006 10/24/2010 C102 Abu
Suffian 678
Hill
Street,
Natural
P63
Sofa
$
125.00
Marrickville Maple
6
1007 10/25/2010 C106 Zulkarnain 3
Brown
Street
P55
Writer’s
Desk
Cherry
$
800.00
Manly 3
Partial Dependency
!
!
Exists when there is a functional dependence in
which the determinant is only part of the primary key
!
PD
PD
14
The proses of
NORMALIZATION
normalization
FD, TD and PD
Full Dependency
Transitive Dependency
3NF
2NF , 3NF
2NF
Transitive
dependency
16
The proses of
NORMALIZATION
normalization
2NF
Transitive
dependency
3NF
3NF
17
The proses of
NORMALIZATION
normalization
ORDER
CUSTOMER Places
PK Order_ID
PK Customer_ID
!
! ! Order_Date
Customer_Name
FK1 Customer_ID
Customer_Address
PRODUCT
PK Product_ID
ORDER
LINE
!
Product_Description
Is
ordered PK,
FK1
Order_ID
Product_Finish
PK,FK2 Product_ID
Product_Standard_Price !Ordered_Quantity
18
SUMMARY
23
DISCUSSION
Normalize
the
following
table.
Show
your
work
using
relational
schema.
UNF
PROJECT
20
DISCUSSION SOLUTION
1NF
Full Dependency
PK PK
1NF
Project_Number
Project_Name
PD
Employee_Number
Emp_Name,Job_Class,Chg_Hour,Hours
TD Job_Class
Chg_Hour
Relation:
√ PK
NO
Repeating
group
DISCUSSION SOLUTION
2NF
1NF,2NF,3NF
Project_Number Emp_Number Hours
Relation:
√ 1NF
NO
partial
dependency
23
DISCUSSION SOLUTION
3NF
EMPLOYEE
ASSIGNMENT
ASSIGNMENT
(Project_Number,
Project_Number Emp_Number Hours
Emp_Number,
Hours)
DISCUSSION
Question 1:
The table shown in Figure 1 is susceptible to update anomalies. Provide examples of
insertion, deletion, and modification anomalies.
!
Question 2:
Describe and illustrate the process of normalizing the table shown in Figure 1 to 3NF.
State any assumptions you make about the data shown in this table.
24