Whats Your Understanding of PK FK

BrentG

Registered User.
Local time
Today, 09:13
Joined
Jun 29, 2006
Messages
20
Hi Guys,

One of the things Im most struggling with from a theoretical standpoint is simply the signifigance of having more than one primary key in a table... and the overall purpose of a foreign key.

Whats your understanding of this... perhaps give an example or one or the other... im totally lost on this!!!

Thanks!
 
I didn't think you could have multiple primary keys in one table (thus the term "primary key). You CAN have multiple fields making up the primary key.

The FK is used in a related table to make the link between the "One" table and the "Many" table, with the PK and FK being the linking fields.
 
I will go along with Joe...

My interpretation on this is your primary key which can be a composite key of more than one column is to help ensure uniqueness and to help in structuring indexes or help in the speed of your queries etc.

Indexes…
http://www.access-programmers.co.uk/forums/showthread.php?t=103298

A Foreign key is to force a constraint on your table(s) for referential integrity or for your relationships. So when you design your ‘relational database' a foreign key helps preserve your design and ensure that changes are automatically ‘cascaded’ through out your database. It wouldn’t make much sense to have a relational database and not have a FK or visa-versa.

And then you get into ‘Normalization’.
http://www.access-programmers.co.uk/forums/showthread.php?t=100211

Which structures you database design and you assign your PK’s and FK’s accordingly.
If you started out in Excel and moving to Access you will have issues with this… and there is no easy way to do this… ;)

HopeThisHelps...
 

Users who are viewing this thread

Back
Top Bottom