Skip to content
Tech Dictionary
DictionaryThe dataContribute
Dictionary/Data & databases
DataIntermediate

Primary key

Also known as PK

A field or set of fields that uniquely identifies each row in a table.

Think of it this way

A database row's official name badge, with no duplicates allowed.

In the real world

A user_id can be the primary key of a users table.

One thing to remember

A primary key can consist of more than one column.

Related

Foreign keyDatabase

Go a little deeper

  • PostgreSQL documentation (opens in a new tab)
  • Google ML Glossary (opens in a new tab)
Improve this entry

What do we build for, if not to lessen each other’s hardship?

Tech Dictionary