Data / Knowledge library
Primary Key
Uniquely identifies each row in a relational table
Why learn Primary Key?
It provides stable identity for references and updates
The problem it solves
It prevents ambiguity when locating one stored entity
Where it came from
Primary Key is a database concept that uniquely identifies each row in a relational table. Its guarantees and tradeoffs depend on the concrete implementation and operating context.
Build your understanding
Work through these exercises in order. Try the task before opening a reference.
- Define Primary Key and distinguish it from a neighboring concept.
- Choose a realistic task where Primary Key is appropriate.
- Identify a failure mode caused by misusing Primary Key.
- Interpret a small design or result involving Primary Key.
- Explain one tradeoff or limitation of Primary Key.
Documentation and sources
- PostgreSQL Documentation (www.postgresql.org)