A functional dependency is called a partial dependency if there is a proper subset of such that ; we say that is partially dependent on . A relation schema is in second normal form (2NF) if each attribute in meets one of the following criteria:
- It appears in a candidate key.
- It is not partially dependent on a candidate key.
Show that every 3NF schema is in 2NF. (Hint: Show that every partial dependency is a transitive dependency.)
Referring to the definitions in Exercise 7.18, a relation schema is said to be in 3NF if there is no nonprime attribute in for which is transitively dependent on a key for .
We can also rewrite the definition of 2NF given here as:
“A relation schema is in 2NF if no nonprime attribute is partially dependent on any candidate key for .”
To prove that every 3NF schema is in 2NF, it suffices to show that if a nonprime attribute is partially dependent on a candidate key , then is also transitively dependent on the key .
Let be a nonprime attribute in . Let be a candidate key for . Suppose is partially dependent on .
-
From the definition of a partial dependency, we know that for some proper subset of , .
-
Since . Also, does not hold, since is a candidate key.
-
Finally, since is nonprime, it cannot be in either or .
Thus we conclude that is a transitive dependency. Hence we have proved that every 3NF schema is also in 2NF.