Professional Documents
Culture Documents
Normalization
Normalization
Normalization
Let, employee 007 resigned from the office. Deletion of that tuple is the loss
of the information of project no D.
Update Anomalies
Emp- Emp- Dept Manager Proj-id Proj- Locatio Weeks-
No Name Start- n on-
Date Project
005 Smith Marketing Tom A 12-93 Peking 11
005 Smith Marketing Tom B 6-94 Kolkata 15
005 Smith Marketing Tom C 09-94 Delhi 6
007 Paul Accounts James B 06-94 Kolkata 3
007 Paul Accounts James D 06-94 Berlin 9
009 King Systems Hurne C 09-94 Delhi 10
010 Holt Accounts James A 12-93 Peking 21
010 Holt Accounts James B 06-94 Belfast 10
006 John Accounts James C 09-94 Delhi 6
IT - 212
Department
name Unique emp no.
7. Make the key for this relation the key identified in (5) and
(if the key in (5) is not unique) the key identified in (2).
Multi-valued attributes:
Proj-id, proj-startdate, location, weeks-on-project
The primary key for the repeating group, proj-id, is not unique
in this relation and so the key of this relation is (emp-no, proj-
id).
(emp-no, proj-id, proj-start-date, location, weeks-on-project)
Solution
There are no more repeating groups.
Note: The word loss in lossless refers to loss of information, not to loss of
tuples or “addition of spurious information”
Decomposition with loss of information
R1
A1 A2 A3
a 1 ab
b 2 ab
R a 2 bc
Join over R(lossy)
A1 A2 A3 A4
A1 A1 A2 A3 A4
a 1 ab X
a 1 ab X
b 2 ab Y
R2 a 1 ab Y
a 2 bc Y
A1 A4 b 2 ab Y
a 2 bc Y
FDs: {A1,A2}→A3 a X a 2 bc X
A2→A4
b Y
a Y Spurious tuples
Loss-less Decomposition
R1
A1 A2 A3
a 1 ab
b 2 ab
R a 2 bc
Join over R
A1 A2 A3 A4
A2 A1 A2 A3 A4
a 1 ab X
a 1 ab X
b 2 ab Y
R2 b 2 ab Y
a 2 bc Y
A2 A4 a 2 bc Y
FDs: {A1,A2}→A3
A2→A4 1 X
2 Y
Properties of Relational Decompositions
Lossless Binary Decomposition:
A decomposition D = {R1, R2} of R has the lossless
join property with respect to a set of functional
dependencies F on R if and only if either
(R1 ∩ R2) R1 or
(R1 ∩ R2) R2.
Chapter 11-31
Properties of Relational Decompositions
Algorithm : Testing for Lossless Join Property
Input: A universal relation R, a decomposition D = {R1, R2, ..., Rm}
of R, and a set F of functional dependencies.
Emp-proj-schema ( ssn,
pno, hours, ename, pname,
Solution: p-loc)
{Ssn, pno} →
hours pno → {pname,
ploc}
Why 2NF?
The relation Emp-proj-schema (not in 2NF) suffers from
anomalies with respect to insertion, deletion and update
operation.
Project1(proj-id, proj-start-date)
X→Z, Z→Y
i.e. X→Z→Y
i.e. X→Y
Update operation: The status value for a given city appears many
times in relation, such redundancy may lead to inconsistent state
after updating the status of a city.
EMP-PROJECT relation
Emp-No Emp- Dept Manager Proj-id Proj- Location Weeks-
Name Start- on-
Date Project
005 Smith Marketing Jones A 12-93 Peking 11
B 6-94 Kolkata 15
C 09-94 Delhi 6
007 Bond Accounts Bloggs B 06-94 Kolkata 3
D 06-94 Berlin 9
009 King Info Hurne C 09-94 Delhi 10
Systems
010 Holt Accounts Bloggs A 12-93 Peking 21
B 06-94 Belfast 10
D 06-94 Hamburg 12
EMP-PROJECT after 2NF
decomposition
Appling 2NF on EMP-PROJECT we get:
Project1(proj-id, proj-start-date)
Project1(proj-id, proj-start-date)
FDs: proj-id→proj-start-date
No transitive dependency.
Department(dept, manager)
Project1(proj-id, proj-start-date)