The question is : What are the attributes called which combine to form a primary key? The answer given is Super key which seems...wrong . Can anyone tell what is the right answer?
-
1What does your reaearch show? What is your textbook name & edition & what does it say? See [ask], hits googling 'stackexchange homework' & the voting arrow mouseover texts. PS There's no such special term. The attributes that appear in some CK are called the prime attributes. A PK is a CK. – philipxy May 08 '19 at 18:22
-
It is not a textbook question. It came in exam . though I reckon prime attribute is that thing ! Thanks for answering dude – Mikhail Tal May 09 '19 at 03:59
-
1I didn't say it was a textbook question, I meant that your textbook is a basic source of information that you should go to before you consider asking a question & that you should show "reasearch effort" & also not ask people to effectively do your research or (home)work for you. – philipxy May 09 '19 at 05:57
-
Thank you !! helped me a lot – Mikhail Tal May 10 '19 at 13:48
1 Answers
What are the attributes called which combine to form a primary key?
Under the relational model:
There's no such special term. The attributes that appear in some CK (candidate key) are called the prime attributes. A PK (primary key) is one CK that you decided to call the PK.
The attributes of a PK are prime, but not all prime attributes need to be attributes of a PK, since there can be CKs other than the PK, or maybe no CK was chosen as PK.
If a relation has only one CK & it is the PK then the PK's attributes are the prime attributes.
But we don't need a special term since we could just say "PK attribute". Just like we don't need "prime" since we could just say "CK attribute".
The answer given is Super key
A superkey is a set of columns whose values are unique. A CK is a superkey that contains no smaller superkey. So a PK is a superkey. But there can be superkeys that are not CKs or PKs--every larger superset of a CK.
PS In SQL, assuming no duplicate rows or duplicate columns names or nulls, so we can take a table to be a relation in the obvious way & apply relational terminology, a UNIQUE declaration or so-called PK declaration declares a superkey.
- 14,416
- 5
- 32
- 77