Prev Next
Functional Dependency (FD):
It is a relationship that exists when one attribute uniquely determines another attribute.
If A and B are attributes of relation R then functional dependency between the attributes is represented by A->B, specifies that B is functional dependent on A where A is determinant set and B is a dependent attribute.
E.g. FD: A -> B
Note: If there is FD: A -> B in a relation R, shows that for the given value of A, we can search the value of B.
Que1. Find out the correct functional dependency
A -> B (FD holds as there is distinct values for each value a, b, c, d)
B -> A (FD doesn't hold as there are three different values when B = 2 i.e. 2 determines b, c, d)
Que 2: Find out correct functional dependency
A -> B X (there are two different values (B = 1,2) when A = 1 and three different values (B= 1, 2, 4) when A = 2)
B -> C X (there are two different values (C= 4, 3) when B = 1 and two different values (C = 4, 3) when B = 2)
B -> A X (there are two different values (A = 1, 2) when B = 1 and three different values (A= 1, 2) when B = 2)
C -> B X (there are two different values (B = 1, 2) when C = 4 and three different values (B= 1, 2, 4) when C = 3)
C -> A FD holds (there are distinct values of A for each value of C)
A -> C FD holds
Theory:
1. functional-dependency-and-attribute-closure
2. functional-dependency
Video:
1. functional-dependency
2. practice problem on functional-dependency
3. practice problem on functional-dependency2
Inference rules used in FD:
1. Reflexive:
A -> B if B ⊆ A
2. Transitive:
A -> B and B -> C then A -> C
3. Decomposition:
If A -> BC, then A -> B and A -> C
4. Augmentation:
If A -> B, then AC -> BC
5. Union:
If A -> B and A -> C, then A -> BC
6. Composition:
If A -> B and C -> D, then AC -> BC
7. Pseudo transitivity:
If X -> Y and WY -> Z, then WX -> Z
Armstrong's Axioms in FD: Armstrong's Axioms
Armstrong's axioms are a set of axioms or inference rules. These are used to infer all the functional dependencies on relational database.
Video on Armstrong's axioms: Armstrong's Axioms
Closure sets/ Attribute closure:
Attribute Closure of an attribute can be defined as set of attributes which we can identified from it.
Closure set of an attribute: Closure set of an attribute
e.g. Find Closure
FD: A ->B
B -> D
C -> DE
CD -> AB
Solution: