View Full Version : 5 pri-key to much???


ice-9
09-30-2005, 01:23 AM
Hi,

Im constructing an ERD.
I got rid of all redundancy, but im stuck atm

heres my question:
Is it bad to have 5 pri-key in a entity?
I an work around it when i leave a tiny bit of redunancy,
but in my perfect opinion its better to have no redunacy!
So can i contruct witout getting problems at a later level, relating to the 5 keys entity?

Pat Hartman
09-30-2005, 02:30 PM
Access allows up to 10 fields in a primary key or index. I have a slight preference for using "natural" keys since they avoid certain kinds of joins. On the other hand, I don't like joins on multiple fields or at least more than two fields. They are too easy to mess up. Bottom line is I would use an autonumber as the pk and add a unique compound index on the 5 fields to enforce the business rules.

JimmyK
10-10-2005, 03:26 AM
I think it's also very important to look at what fields you are putting as the primary key.