Sunday, May 18, 2008

What is the difference between a primary key and a foreign key?

A primary key is a field, or combination of fields, whose value is unique for each
row, or record, in the table. For example, the Employee ID field is the primary
key for the Employees table. No two employees can have the same ID.

A foreign key "points to" a primary key field in a related table. For example, in
the Northwind database, the Orders table contains a Customer ID field. Each
Customer ID in the Orders table identifies which customer made the order.

Your Title