-1

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?

ajjohnson190
  • 494
  • 2
  • 7
  • 21
  • 1
    A schema "with" FDs is not enough info to answer the question. One needs to be given enough info to determine a *cover*. – philipxy Mar 03 '19 at 21:05
  • 1
    Reference/quote your algorithm & show the steps of your work following it. Your first "I found" is wrong. But your question is not detailed enough for us to tell you where you went wrong. (You seem to wrongly think AB->C implies B->C.) – philipxy Mar 03 '19 at 21:09
  • 1
    A set determining all attributes is only a CK if no proper subsets of it are superkeys. So if you had been right about the closure of XY, you still wouldn't have shown that it was a CK. – philipxy Mar 03 '19 at 21:27

2 Answers2

1

{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.

Erwin Smout
  • 18,113
  • 4
  • 33
  • 52
0

Since the closure of XY doesn’t include all of the attributes of the relation, it can’t be a candidate key. A candidate key is the minimal amount of attributes that can be used to identify a tuple uniquely. The closure of XY would only include X and Y.

  • 1
    "A candidate key is [a set with] the minimal amount of attributes that can be used to identify a tuple uniquely." is not correct. Use enough words to say what you mean. PS This would be easier to follow if your last sentence came first. Also if your definition of CK was written in a way that has something to do with the preceding text. Otherwise what is the point of giving it? – philipxy Mar 03 '19 at 21:13