Rules for Functional Dependency-
Rule-01:
A functional dependency X → Y will always hold if all the values of X are unique (different) irrespective of the values of Y.
Example-
Consider the following table-
A |
B |
C |
D |
E |
5 |
4 |
3 |
2 |
2 |
8 |
5 |
3 |
2 |
1 |
1 |
9 |
3 |
3 |
5 |
4 |
7 |
3 |
3 |
8 |
The following functional dependencies will always hold since all the values of attribute ‘A’ are unique-
- A → B
- A → BC
- A → CD
- A → BCD
- A → DE
- A → BCDE
In general, we can say following functional dependency will always hold-
A → Any combination of attributes A, B, C, D, E |
Similar will be the case for attributes B and E.
Rule-02:
A functional dependency X → Y will always hold if all the values of Y are same irrespective of the values of X.
Example-
Consider the following table-
A |
B |
C |
D |
E |
5 |
4 |
3 |
2 |
2 |
8 |
5 |
3 |
2 |
1 |
1 |
9 |
3 |
3 |
5 |
4 |
7 |
3 |
3 |
8 |
The following functional dependencies will always hold since all the values of attribute ‘C’ are same-
- A → C
- AB → C
- ABDE → C
- DE → C
- AE → C
In general, we can say following functional dependency will always hold true-
Any combination of attributes A, B, C, D, E → C |
Combining Rule-01 and Rule-02 we can say-
In general, a functional dependency α → β always holds-
If either all values of α are unique or if all values of β are same or both.
|
Rule-03:
For a functional dependency X → Y to hold, if two tuples in the table agree on the value of attribute X, then they must also agree on the value of attribute Y.
Rule-04:
For a functional dependency X → Y, violation will occur only when for two or more same values of X, the corresponding Y values are different.
Courtesy:Gatevidyalay