1

Given relation

R(a,b,c)

and that there are no functional dependencies:

How are candidate keys computed?

philipxy
  • 14,867
  • 6
  • 39
  • 83
nicomp
  • 4,344
  • 4
  • 27
  • 60
  • Does this answer your question? [How do you determine functional dependencies and a primary key?](https://stackoverflow.com/questions/27372640/how-do-you-determine-functional-dependencies-and-a-primary-key) – philipxy Aug 29 '23 at 14:15
  • Your post is a duplicate many many times over. [research effort](https://meta.stackoverflow.com/q/261592/3404097) [homework](https://meta.stackoverflow.com/q/334822/3404097) [ask] [Help] – philipxy Aug 29 '23 at 14:20

1 Answers1

1

I suppose you mean there are no non-trivial functional dependencies (since dependencies like a -> a always hold).

Each relation is a set, so it must have at least a candidate key, that is a set of attributes that determines each attribute of the relation.

Consider an attribute like a, which is not present in any non-trivial functional dependency. In order to be determined by a candidate key, that candidate key must contains it.

So the rule is very simple: each attribute that is not present in any non-trivial functional dependency must be present in every candidate key.

In this case no attribute is present in any non-trivial functional dependency, so that the only possible candidate key is abc. In fact it determines all the attributes through the trivial dependency abc -> abc, and no other candidate key has this property.

Renzo
  • 26,848
  • 5
  • 49
  • 61