Re: What are the differences between the terms, CANDIDATE KEY, PRIMARY KEY, SUPER KEY, COMPOSITE KEY?

From: Brian Selzer <brian_at_selzer-software.com>
Date: Fri, 24 Feb 2006 19:23:03 GMT
Message-ID: <r2JLf.34546$Jd.7266_at_newssvr25.news.prodigy.net>


Since a key is a set of attributes, a non-prime attribute is an attribute that is not an element of a candidate key.

"Abhishek" <abhisheksgumadi_at_gmail.com> wrote in message news:1140803769.694732.218140_at_j33g2000cwa.googlegroups.com...

> Now that I have understood the different types of keys and their
> differences, can you tell me what is a NON-PRIME ATTRIBUTE? Is it an
> attribute which is not a candidate key?
> Brian Selzer wrote:

>> A superkey is a set of attributes which uniquely identifies a tuple in a
>> relation.
>>
>> A candidate key is an irreducible set of attributes which uniquely
>> identifies a tuple in a relation.
>>
>> A composite key is a candidate key that has more than one attribute.
>>
>> The primary key is a candidate key. Any candidate key can be the primary
>> key, but usually the candidate key that participates in referential
>> constraints is designated as the primary key.
>>
>> (a) is imprecise. A collection is different from a set: it's a multiset.
>> Also, a candidate key must be irreducible, meaning that if any of the
>> attributes are excluded, the remaining attributes do not uniquely
>> identify a
>> tuple.
>>
>> (b) is incorrect. The database designer, not the DBMS, chooses which
>> candidate key is primary. In addition, a candidate key can have more
>> than
>> one attribute, so it's possible to have a composite primary key.
>>
>> I've addressed (c) above.
>>
>> A candidate key is a superkey, but a superkey is not necessarily a
>> candidate
>> key. A superkey may be reducible, meaning that even if one or more
>> attributes are excluded, the remaining attributes still uniquely identify
>> a
>> tuple.
>>
>> "Abhishek" <abhisheksgumadi_at_gmail.com> wrote in message
>> news:1140522359.762187.213930_at_o13g2000cwo.googlegroups.com...
>> > Hi,
>> > Can anybody tell me the differences between the above mentioned terms?
>> > Also please tell me if one can be the other and vice versa..please
>> > elaborate with the helpof a table if possible. Also please tellme if
>> > the below statement by me is correct..
>> > a) Any attribute or a collection of attributes which uniquely
>> > identifies the tuples in a relation is called a canditate key.this
>> > candidate key thus can contain a single attribute or a collection of
>> > attributes.
>> > b) one of the attributes is chosen by the DBMS to identify the tuples
>> > uniquely and this attribute is called the primary key.
>> > c) A primarykey is a candidate key.all candidate keys cannot be a
>> > primary key.
>> > Now,,,what is the superkey?
>> >
> Received on Fri Feb 24 2006 - 20:23:03 CET

Original text of this message