View Single Post
12-18-2007, 10:37 PM
Luk3 is offline Luk3
Luk3's Avatar
Status: Senior Member
Join date: Nov 2006
Location: Colchester, UK
Posts: 760
iTrader: 3 / 100%

Luk3 is on a distinguished road

Send a message via MSN to Luk3


Yeah usually the foreign key is the primary key from another table.

Say you have a customer table and the headers are:
Customer ID [Primary]
Customer Name

and then you have an Orders table:
Order ID [Primary]
Order item
Customer ID [Foreign]

The tables link via the foreign key. Creates a relationship, Referential Intergrity FTW! ;D