Databases & SQL
Primary Key
The unique identifier that makes every row in a table distinct.
Reviewed by the RadarTrek editorial team · June 2026
A primary key is a column (usually called "id") whose value uniquely identifies a single row in a table. No two rows can share the same primary key. It's how you refer to one exact record — "user 42" means the row where id = 42 — and it's the anchor that foreign keys link back to.
Why it matters
- —Every table needs one — it's how the database (and you) refer to a specific record.
- —Foreign keys in other tables reference a primary key to link related data together.
- —Databases automatically index primary keys, making lookups by id extremely fast.
Where to learn this
🎓
What Is a Database?
SQL for Builders course
This is the exact lesson that covers this term in depth — with examples, diagrams, and a hands-on exercise.