Functional Dependencies
Definition
- A relation
- A set of attributes in R, (think function input)
- A set of attributes in R, (think function output)
A functional dependency X → Y holds
in relation R if for two different rows, r
and s: If r[X] = s[X] then r[Y]
= s[Y].
Equivalent statements
- r[X] ≠ s[X] or r[Y] = s[Y]
- Either the Xs are different, or they are the same and then the Ys are the same too.
- The Ys are the same whenever the Xs are.
Example
| X → Y |
X → Y does not hold |
| X |
Y |
Z |
| 1 |
10 |
aaa |
| 2 |
20 |
bbb |
| 2 |
20 |
ccc |
|
| X |
Y |
Z |
| 1 |
10 |
aaa |
| 2 |
20 |
bbb |
| 2 |
21 |
ccc |
|
|