0

Relation R consists of columns {A,B,C,D}. A uniquely defines a tuple. So does B. A and B are candidate keys, since they are minimal. What about a set {A,B}? {A,B} together uniquely defines a tuple, but it is not minimal.

What is the term for {A,B}. Usually non-minimal candidate keys are called super keys. Is there a special name for a union of candidate keys?

EDIT:

Excuse me for imprecise question. It can indeed be clearer. As far as I understand, key == candidate key == minimal set of attributes that uniquely define a tuple.

sanjihan
  • 5,592
  • 11
  • 54
  • 119
  • You say that each of {A} & {B} "uniquely defines a tuple"--we have take your word about R. So they are superkeys. Then you say they are CKs (candidate keys) "since they are minimal". Be aware that if all you actually know is that they are superkeys, they are not necessarily CKs. Simple superkeys are only CKs if also {} is not a CK. {} is a CK when the valid values for a relation have at most one row. – philipxy Aug 28 '19 at 16:38
  • 1
    This is much clearer. (Please don't insert EDITs/UPDATEs, just make your post the best presentation possible.) – philipxy Aug 28 '19 at 16:48
  • There are no "non-minimal candidate keys". Presumably you mean, "non-minimal unique attribute sets". – philipxy Aug 30 '19 at 03:48

2 Answers2

4

The union of candidate keys K1 and K2 yields a candidate key iff K1=K2, that is, if they are in fact the very same key. In all other cases, it will by definition yield a (super)key that isn't irreducible, and if your definition of "candidate key" is that it is an irreducible (super)key then (the result of) that union is obviously no longer a candidate key.

As for keys terminology, I think most respectable (there are others too) textbooks stick to the convention :

"superkey" = just any key
"candidate key" = irreducible (=minimal) superkey
non-minimal superkey = "proper superkey" (and not just "superkey" as you stated)
"key" is supposed to be used as synonym for "candidate key" but the linguistics of the word cause it to often also be used with the meaning of "just any key". Beware !

And no, I don't think there is a special term for the particular kind of proper superkey that happens to be a union of two (or more) candidate keys. There is no useful purpose in ever knowing such a thing about a key.

Erwin Smout
  • 18,113
  • 4
  • 33
  • 52
-1

Candidate key:

A candidate key is a combination of attributes that can be uniquely used to identify a database record without referring to any other data.

The word Candidate actually means that the keys are candidates for Primary key selection, so it is clear that yes it's up-to you which candidate key or combination of candidate keys you want to qualify for Primary key.

Community
  • 1
  • 1
Zia Ullah
  • 93
  • 1
  • 1
  • 8
  • This doesn't answer the question. (Also, the question is unclear. See my comment on it.) – philipxy Aug 27 '19 at 23:47
  • 1
    In the RM (relational model) a CK is "a combination of attributes that can be uniquely used to identify a database record" that does not contain "a combination of attributes that can be uniquely used to identify a database record". [SQL gives its own meanings to many RM terms.](https://stackoverflow.com/a/46029100/3404097) The question is not tagged SQL & uses RM terms like relation, tuple & attribute. – philipxy Aug 28 '19 at 02:47
  • 2
    Unhappily, addressing part of an unclear question does not make for a good answer. – APC Aug 28 '19 at 10:37
  • 1
    Unclear questions merit downvotes, close votes & comments asking for clarification, not answers. Answering unclear questions leads to a mess. [answer] [ask] [help] – philipxy Aug 28 '19 at 16:51