Multivalued Dependency in Normalization
What is multivalued dependency (MVD)?
A multivalued dependency (MVD) is a type of database dependency that occurs when one attribute in a relation determines multiple independent sets of values for another attribute. It represents a situation where two attributes are not functionally dependent, but are independently determined by a third attribute.
Formal Definition
Example
Consider a student who may learn multiple programming languages and play multiple sports — both independently.
|
Student |
Language |
Sport |
|
Ravi |
Java |
Cricket |
|
Ravi |
Python |
Cricket |
|
Ravi |
Java |
Badminton |
|
Ravi |
Python |
Badminton |
Here:
For Student = Ravi,Languages = {Java, Python}
-
Sports = {Cricket, Football}
Language and Sport are independent, but both depend on Student.
So, we have:
This is a classic multivalued dependency.
Why MVD matters?
Multivalued dependencies lead to data redundancy and anomalies.
To remove these anomalies, a relation with non-trivial MVDs should be decomposed into 4th Normal Form (4NF).
Example decomposition:
R(Student, Language, Sport) ⟶
No comments:
Post a Comment