1
R = {A, B, C, D, E, F, G, H, I, J}
F = 
{{A,B} -> {C}, 
{A}-> {D,E}, 
{B} -> {F}, 
{C}-> {B}, 
{F}->{G,H},
{D}->{I,J}

The question is: What is the key for R?

I assume based on how the question has been formulated that there is one single candidate key which they want me to find.

If i have AB+ i can determine all the attributes in the relation meaning AB is a superkey. The proper subsets of the superkey AB which are {A} and {B} are not superkeys, hence why AB then is a candidate key. But from what i can tell there is another candidate key aswell which we can find if we have AC+. Is this correct or am i making a mistake somewhere?

  • Your "I have these FDs" doesn't make sense. "These are all the FDs that hold"?--Not possible. "These are all the non-trivial FDs that hold"?--Not possible. "These are some FDs that hold"?--Question can't be answered. Find out what a *cover* is & what the exact conditions are to apply a particular definition/rule/algorithm. To determine CKs & NFs we must be given FDs that form a cover. Sometimes a minimal/irreducible cover. And the set of all attributes must be given. PS {} is also a proper subset of {A,B}. – philipxy Mar 18 '22 at 23:10

1 Answers1

1

Yes, you are correct: assuming that F is a cover of the dependencies of R, the relation has two candidate keys: {A, B} and {A, C}.

This can be easily shown by computing both {A,B}+ and {A,C}+.

Renzo
  • 26,848
  • 5
  • 49
  • 61
  • Thank you! Do you know why it asks "what is the key for R?" when there are two and not one CK? – onetimeagain Mar 20 '22 at 13:08
  • Sorry, I don’t know. Maybe the question is about the primary key, but I doubt, since there are two candidate keys, of equal length, and there is no reason to choose one wrt to the other as primary key. – Renzo Mar 20 '22 at 13:12
  • I see. Thanks anyways. Very much appreciated. – onetimeagain Mar 20 '22 at 13:20