-1

I am working with a relational database's set of attributes and set of functional dependencies and have a specific question about which keys would be considered candidate keys of this schema.

The set of attributes I am working with is:

R = (A, B, C, D, E, F, G, H)

And the set of functional dependencies are:

F = { AC -> B, AB -> C, AD -> E, C -> D, BC -> A, E -> G, ABE -> D, FG -> E}

So here's what I am trying to figure out: Would this set of attributes have any candidate keys since H is not determined/mentioned at all in the set of functional dependencies?

By definition, candidate keys determine everything else, correct? If H is not determined by anything but itself, would there still be any candidate keys in this set?

Any insight is appreciated. Thanks!

user1462294
  • 167
  • 4
  • 13
  • 2
    Is R a relation schema or just a set of attributes? If R is a relation then {A,B,C,D,E,F,G,H} must be a superkey and therefore R has at least one candidate key. – nvogel Oct 13 '13 at 14:15

1 Answers1

1

Recall (Wikipedia) that

In the relational model of databases, a candidate key of a relation is a minimal superkey for that relation; that is, a set of attributes such that the relation does not have two distinct tuples (i.e. rows or records in common database language) with the same values for these attributes (which means that the set of attributes is a superkey) there is no proper subset of these attributes for which (1) holds (which means that the set is minimal).

Hence,

So here's what I am trying to figure out: Would this set of attributes have any candidate keys since H is not determined/mentioned at all in the set of functional dependencies?

This simply means that H will be contained in every candidate key R might have. For instance, ACFH is a candidate key. You can infer B because of AC->B, D because of C->D, E because of AD->E, and G because of E->G. On the other hand, you cannot infer F from ACH, H from ACF, C from AFH and A from CFH.

Alexander Serebrenik
  • 3,567
  • 2
  • 16
  • 32