What is a functional dependency, and what is attribute closure?
MediumConceptNormalization
Answer
A functional dependency (FD) X -> Y means that the value of X determines the value of Y: any two rows with the same X must have the same Y. For example, roll -> name, because one roll number belongs to one student.
- Trivial FD:
Yis a subset ofX, such as{roll, name} -> name. Non-trivial FDs are the useful ones. - Armstrong's axioms derive new FDs: reflexivity, augmentation (
X -> YgivesXZ -> YZ) and transitivity (X -> YandY -> ZgiveX -> Z). - The closure
X+is the set of all attributes thatXdetermines. IfX+contains every attribute,Xis a super key; if, in addition, no proper subset ofXis a super key,Xis a candidate key.
Example: R(A, B, C, D) with A -> B, B -> C and C -> D:
- Start with
A+ = {A}.A -> Badds B,B -> Cadds C, andC -> Dadds D. A+ = {A, B, C, D}, soAis a candidate key.B+ = {B, C, D}does not contain A, soBis not a key.