Databases

Explain Primary Key and Foreign Key

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

Primary Key: each row in every table should a unique identifier that represents the row.

Foreign Key: a reference to another table's primary key. This allows you to join table together to retrieve all the information you need without duplicating data.