Professional Documents
Culture Documents
01.Functional Dependencies Till 5 NF
01.Functional Dependencies Till 5 NF
and Normalization
Relational Database Design-Part II
Good relation schema design
Goodness of relation schema can be done by
(a) Logical level
(b) Implementation level
Informal Design Guidelines For Relation Schemas
i) Semanitics of the Relation Attributes
Guidelines 1:
Design a relation schema that do not combine
attributes from multiple entity types & relationship types.
Ex.Emp_dept
(a) ssn, ename, add, dno, dname,mgrssn
Ex. Emp_proj
ii) Redundant Information in Tuples and Update anomalies
when two attributes are mixed.
Update anomalies
i) Insertion anomaly
ii) deletion anomaly
iii) Modification anomaly
Ex. Emp_Proj
to.
Inversely- Cannot insert an employee unless he/she is
assigned to a project.
Delete Anomaly
When a project is deleted, it will result in deleting all the
Empid ENAME
Project Number determines project name and location
IR1, IR2, IR3 form a sound and complete set of inference rules
These are rules hold and all other rules that hold can be deduced
from these
Some additional inference rules that are useful:
Decomposition: If X -> YZ, then X -> Y and X -> Z
Union: If X -> Y and X -> Z, then X -> YZ
Psuedotransitivity: If X -> Y and WY -> Z, then WX -> Z
The last three inference rules, as well as any other
inference rules, can be inferred from IR1, IR2, and IR3
(completeness property)
CD+=ACD
So our candidate keys are AB and BC..
Properties of Normalization
There are two important properties of decompositions:
a) Loss less join/ Non additive join property
Decomposed relation doesn’t give spurious tuples.
b) Dependency preservation
each functional dependency is there in some decomposed relation.
Note that: Property (a) is extremely important and cannot be sacrificed.
Property (b) is less stringent and may be sacrificed.
A Lossy Decomposition
Example of Lossless Decomposition
Decomposition of R = (A, B, C)
R1 = (A, B) R2 = (B, C)
Denormalization - Getting back the base relation.
1NF