View Full Version : Auto# 4 PK/FK on all tbls?


mdbBound
12-22-2003, 12:23 PM
Hi guys!

I did some reading and I just want to make sure that I understand this right. If I will have 10 tables, all of them can have the autonumber as their primary key which are also going to be a FK in the other tables.

How do you then differentiate them, I mean won't they get mixed up when you create the relationships because all tables have same PK and FK at the same time?

Please clarify. I appreciate your inputs.

Thank you.

Pat Hartman
12-22-2003, 09:01 PM
Normally, you give the autonumber field a meaningful name. I use all or part of the table name followed by ID. So the pk of the Customer table would be CustomerID. When you use the CustomerID as a fk, retain its meaningful name. So in the Order table, you will have OrderID as the pk and CustomerID as a foreign key to the Customer table.

mdbBound
12-23-2003, 08:20 AM
Thank you Pat