Tuesday 21 August 2012

Foreign Key

  • A foreign key is a copy of the primary key. If placed in another table, the two tables then have a link with each other.
  • Instead, tables use an extra attribute called the foreign key to link tables together.
  • The foreign key is always placed in the entity that is the "many" entity of the one to many relationship
  • The reason for this is very simple, each table's cell can only contain one value, it would not make sense to place the playerID foreign key on the team's table
  • A field in a table that appears as match of the primary key in another table.

No comments:

Post a Comment