Fields that are part of a table relationship are called keys. A key usually consists of one field, but may consist of more than one field. There are two kinds of keys:
- Primary key – To ensure that no two records in a table are identical, one field in each table is designated the primary key. A primary key consists of one or more fields that uniquely identify each record that you store in the table. Often, there is a unique identifier, such as an ID number (Employee ID, Customer ID, etc), a serial number, or a social security number that serves as the primary key. Always choose a primary key whose value will not change. A key icon appears next to the name of the primary key field. AutoNumber data type fields make good primary keys.
- Foreign key – A table can also have one or more foreign keys. A foreign key contains values that correspond to values in the primary key of another table. For example, you might have an Orders table in which each order has a customer ID number that corresponds to a record in a Customers table. The customer ID field is a foreign key of the Orders table.