Page 2 of 10PREVNEXT

Build relationships for a new Access 2007 database

Primary and foreign keys in a table structure


In a database, relationships are how your tables "talk" to each other. If your tables don't talk, you can't get answers from your data. You create relationships by including a field from one table as a field in a related table.

Callout 1 The field you include is called a primary key. Each of the tables in your database has a primary key, and you include it as a new field in another table to create a relationship with that other table.
Callout 2 When you share a primary key, the new field in the second table is called a foreign key.
Callout 3 The picture illustrates one way this can work. In order to associate assets with suppliers, the foreign key field in the Assets table provides a list of company names. Behind the scenes, Access uses the values in the primary and foreign keys to synchronize the two fields. In turn, you can use that relationship to answer questions such as, "Which company provided a given computer?"

This lesson, and the practice at the end of this course, show you how to create that type of relationship.

Page 2 of 10PREVNEXT