Composite Key vs Primary Secondary Keys

E

Elaine

Hello,

Can you give me a plain description of the difference between Composite Keys
and Primary and Secondary keys?

I thank you for taking time to help me.
 
V

VT @ home

Hello,

Can you give me a plain description of the difference between Composite Keys
and Primary and Secondary keys?

I thank you for taking time to help me.

Any key can be composite (i.e. made up by more than one column) or not (i.e. made up by only one column).

A secondary key (best: a candidate key) is a key (composite or not) which is not guaranteed to be unique for every
instance of the table; that means: in this moment each row in the table contains different values in the column(s)
making up the key, but in the future maybe the table will contain one or more rows with identical values in the
column(s) making up the key.

A primary key is a key (composite or not) which is guaranteed to be unique for every instance of the table; that means
the table will NEVER contain rows with identical values in the column(s) making up the key.

I hope plain enough ...

Vincenzo Turturro

Certificato Eucip Core Level
ITA 0000-002299 del 14/05/2007
 
J

John W. Vinson

Hello,

Can you give me a plain description of the difference between Composite Keys
and Primary and Secondary keys?

I thank you for taking time to help me.

A Composite Key is a key made up of two or more fields in its table. For
example, you might have a table for which the Primary Key consists of a
Category and a Subcategory. Either one can be duplicated but the combination
cannot.

A Primary Key (which can be a single-field key or composite key) uniquely
identifies one record in its table.

A Foreign Key isn't visibly distinguished in the table design; it's defined by
how it is used - as a link to the Primary Key of some other table.
 
T

tedmi

To add to the other responses, let me phrase this in terms of a real-world
example. Think of an employee list for a company. It can be sorted by the
composite key of LastName, FirstName. But that cannot be the primary key,
because multiple people may have the same 2 names. That's why companies
assign an employee ID no. to uniquely identify each employee. Such a unique
identifier is a primary key.
 
D

Dale Fye

And then you have the discussion of Natural vs. Artificial keys(this tends to
be a very emotional topic).

If you want to read more on that subject, search on "artificial" in this
newsgroup. There was a discussion last December that have 79 posts to the
thread.
 
K

Klatuu

Haven't artificial keys been replaced by newer technology, key implants?

Sorry, I can't help myself <g>
 
D

Dale Fye

Everybody wants to be a comedian!

Klatuu said:
Haven't artificial keys been replaced by newer technology, key implants?

Sorry, I can't help myself <g>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top