michigan informatics

 
 

Primary Key

The contacts table also contains a unique ID field that is defined as the Primary Key (1). In addition, it contains a second ID field, called the participantID (2). This is referred to as a Foreign Key, because it relates to a specific record in another table (in this case, the participants table).

The values of participantID in the contacts table are not unique. Instead, each value relates to a unique value of the ID field in the participants table. Records that contain a value of 1 in the participantID field in the contacts table relate to Mr. John A Doe in the participants table.

In this way, the participants table and the contacts table are related. Each person in the participants table is contacted multiple times, and so has multiple records in the contacts table. In our sample database, Mr. John Doe was contacted twice, Mrs. Jane Smith was contacted once, and Ms. James Jones was contacted 4 times. 

primary key