juniorDatabases
What is a Primary Key and a Foreign Key?
Updated Apr 28, 2026
Short answer
A Primary Key uniquely identifies a record; a Foreign Key establishes a link between data in two tables.
Deep explanation
Deep dive into foundational storage. Understanding how data is stored on disk vs memory. Discussion on the relational model proposed by E.F. Codd.
Real-world example
A library system where books (primary key) are linked to authors (foreign key).
Common mistakes
- Confusing NULL with an empty string.
Follow-up questions
- What is 3NF?