Previous Topic: Select Each Entity’s Unique IdentifierNext Topic: Normalize the Entities


Identify Foreign Keys

Note that the RACE entity contains the primary keys of the HORSE (Horse code) and JOCKEY (Jockey code) entities. The Horse code and Jockey code are needed as attributes in the RACE entity to identify the horses and jockeys that competed in each race. However, neither the Horse code nor the Jockey code are needed to identify the RACE entity; in other words, neither Horse code nor Jockey code are primary keys of RACE. Such non-key attributes of an entity that are primary keys of another entity are known as foreign keys. In the following table, foreign keys are identified.

Entity

Attribute

Primary Key

Foreign Key

COURSE

Course code
Course name

Course code

N/A

HORSE

Horse code
Horse name
Horse gender
Date of birth

Horse code

N/A

JOCKEY

Jockey code
Jockey name
Jockey gender

Jockey code

N/A

SIRE

Sire code
Sire name
Sire Date of birth

Sire code

N/A

DAM

Dam code
Dam name
Dam Date of birth

Dam code

N/A

RACE

Course code
Course name
Race date
Race time
Race name
Going conditions
Distance
Prize money
Horse code
Horse name
Horse gender
Date of birth
Jockey code
Jockey name
Finishing position
Handicap
Entry status

Course code
Race date
Race time

Horse code
Jockey code