Keys

PRIMARY KEY

A primary key is a field which uniquely identifies a record in a table e.g. Mountain Name or Customer ID or email address 

FOREIGN KEY

  • A foreign key is used to link both tables  together.
  • The foreign keys is in the many table and is link to the primary key in the other table.>

The Attribute countryCode is the Primary key in the Country entity, but is also the Foreign Key in the City entity.