databasedatabase-designcandidate-key

Why is XY not a candidate key?


I have a relation R(V,W,X,Y,Z) with functional dependencies

V → W

WX → Z

ZY → V

Since X and Y are not on the LHS, I found the closure of {XY} to equal {V,W,X,Y,Z}, making XY a candidate key. When I checked my answer using this tool, it said XYV, XYW and XYZ were the candidate keys, and that the closure XY was {X,Y}. Why is XY not a candidate key?


Solution

  • {X,Y} is not a [super]key because (informally speaking) no FD or combination thereof allows to determine what the values for all the other attributes of the relation schema are, given only X,Y.

    The FDs say which attribute values you are able to determine (those on the RHS), if you are given values for all of the attributes on the LHS. There is not a single FD for which you are given all the LHS values if you are given only X and Y.