DBLect8
DBLect8
March 4, 2021
Functional dependency
Definition & purpose of normalization
Normalization types
Anomalies
Partial Dependency:
If an attribute which is not a member of the key is dependent on
some part of the key (if we have composite/candidate key) then that
attribute is partially functionally dependent on the key.
Let {A,B} is the Key and C is no key attribute.
Then if {A,B} → C and [B → C or A → C] holds
We say→ C is partially functionally dependent on { A, B }
Note: Partial dependency occurs when a non-prime attribute is
functionally dependent on part of a candidate/composite key.
Full Dependency:
An attribute is fully functional dependent on another attribute, if it is
functionally dependent on that attribute and not on any of its proper
subset.
For example, an attribute Q is fully functionally dependent on another
attribute P, if it is functionally dependent on P and not on any of the
proper subset of P.
Let {A,B} is the Key and C is no key attribute.
Then if {A,B} → C and [B→ C & A → C] doesn’t hold
I (i.e; if A can’t determine C and B can’t determine C), then C fully
functionally dependent on { A, B }
Transitive Dependency :
I In mathematics and logic, a transitive relationship is a relationship of
the following form:
I ”If A → B, and if also B → C, then A → C.”
I Example: If Mr X >Y and Y >Z then X >Z.
Generalized way of describing transitive dependency is that:
If A functionally governs B, AND
If B functionally governs C THEN
A functionally governs C ,Provided that neither C nor B determines A
What is Normalization?
Normalization: is a database design technique/concept that
eliminates undesirable characteristics like (Insertion, Update,
Redundancy and Deletion anomalies).
Normalization is the transformation of complex user views and data
stores to a set of smaller, stable, and easily maintainable data
structures.
Normalization divides larger tables into smaller tables and links them
using relationships.
Example1(unnormalized)
Normalized(1st NF)
Example2
Example2(unnormalized)
The above table is not in 1NF as the rule says “each attribute of a
table must have atomic (single) values”, the emp-mobile values for
employees Jon & Lester violates that rule.
To make the table complies with 1NF we should have the data like
this:
Example2(1NF)
Example2:
After normalization
Data redundancy
Insert anomaly
Deletion anomaly
Update anomaly