Candidate Key Using All Attributes

TastyWheat

Registered User.
Local time
Today, 05:30
Joined
Dec 14, 2005
Messages
125
Most of the tables in my database have a single attribute candidate key. I have one very insignificant table that doesn't seem to warrant a surrogate key (autonumber) but a record can only be uniquely identified by all 4 of its attributes. Should I actually bother to make all of the attributes a primary key? Is this some tell tale sign I have a poor relationship going on?
 
If the four-field table is a junction acting as a many/many link between other tables, it is sign of maximum efficiency. Junction tables don't need ANY keys. But the tables to which they are related surely need them.

On the other hand, if the table is NOT a junction table, you might indeed have a questionable situation going on. Still, you have to ask yourself this question:

In the 4-field table, are all four fields proper attributes of the thing being referenced / described by the table? If the answer is YES, then what you describe certainly IS possile.
 
Sounds good. I just wanted to make sure it's okay before I use it.
 
If you have verified relevance of each of the four fields and they seem to belong there, only time will tell whether one of them doesn't. Until then, use them as they are and be happy!
 

Users who are viewing this thread

Back
Top Bottom