NEW: English for Tech Bundle → Save 38%
Your progress…

Loading your progress…

Home
Technical Vocabularynoun · /ˈpraɪ.mer.i kiː/

primary key

primary key — A primary key is a column or set of columns in a database table that uniquely identifies each row.

In simple English

In database design, a primary key serves as the main identifier for each record. When you create a table, you designate one or more columns as the primary key to guarantee that every row can be uniquely identified. This is fundamental to data integrity and relational database structure. Primary keys are often integers (like user IDs or product IDs) but can be any data type. The primary key is used internally by the database to speed up searches, create indexes, and establish relationships between tables through foreign keys. In real tech workplaces, discussions about primary keys are common when designing schemas, migrating data, or debugging database issues.

Understand what a primary key is, why it matters in databases, and how to use it in table design.

At a glanceCEFR C1
Commonness5/5
Versatility4/5
FormalityCasualFormalFormal
Spoken ↔ WrittenSpokenWrittenBoth
Directness ↔ DiplomaticDirectDiplomaticDirect
RegionUS and UK

Say it like this

  • Set the user_id as the primary key
  • This table is missing a primary key
  • We need to drop and recreate the primary key

Use it at work

Database design

  • Use a UUID as the primary key.
  • Every table needs a primary key.

Debugging

  • The insert failed because of a duplicate primary key.
  • The primary key sequence is out of sync.

Code review

  • Should the primary key be a composite key here?
  • Don't expose the primary key in the URL.

Don't say this

✕We set multiple primary keys on the same table.
✓We set one primary key on the table and additional unique constraints for other columns that need uniqueness.

A table can have only one primary key, though it may contain multiple columns. Use unique constraints for additional uniqueness requirements.

Don't mix it up

How primary key differs from similar terms
TermWhat it isWho writes or uses itWhen
primary keyUnique ID for each rowDevelopersEvery table
foreign keyPoints to a row in another tableDevelopersLinking tables

Practice

Try it

4 quick exercises

Pick the most natural phrasing

1. Your colleague asks about table design. Which sounds most professional?

Complete the sentence

2. We should _______ the email column _______ _______ _______ for the accounts table.

Spot the mistake

3. Which sentence uses primary key incorrectly?

Rewrite naturally

4. Rewrite in professional tech English: 'The thing that makes each row different in the database is called the primary key. It has to be special and cannot be empty.'

Say it out loud

Phrase 1 of 3

"Set the user_id as the primary key"

We don't save your recording. The word check uses your browser's speech recognition.

More about primary key

Real examples(3)

  • in a standup

    "I discovered the users table didn't have a primary key defined, so I added the user_id column as the primary key."

  • in a code review

    "Good catch—the primary key on the orders table should be order_id, not a composite of user_id and date."

  • in a team meeting

    "When we migrate to the new database, we need to ensure every table has a primary key before we import the data."

More mistakes(2)

Handle with care. Do not confuse primary key with unique key or foreign key. A primary key must be unique and cannot be null, but not all unique keys are primary keys.

  • ✕The primary key in the users table can be null sometimes.
    ✓The primary key must always have a value and can't be null.

    By definition, a primary key must have a value in every row to uniquely identify that row. Null values would break this guarantee.

  • ✕We use the same primary key in two different tables.
    ✓Each table has its own primary key. Other tables reference it as a foreign key.

    Primary keys are unique to their table. Other tables link to it using foreign keys, not by duplicating the primary key.

Other forms(3)

  • primary key noun

    "The primary key ensures each user record is unique."

  • primary key constraint noun phrase

    "We added a primary key constraint to the products table."

  • composite primary key noun phrase

    "This junction table uses a composite primary key made up of two foreign keys."

Often used with(5)

  • define a primary key · To establish which column or columns serve as the primary key
  • set as primary key · To designate a column as the primary key during table creation
  • primary key constraint · The database rule that enforces primary key uniqueness and non-null values
  • composite primary key · A primary key made up of two or more columns combined
  • drop primary key · To remove the primary key from a table

Similar words(3)

  • surrogate key · An artificially created primary key (like an auto-incrementing ID), different from a natural key based on real data
  • unique identifier · A broader term meaning any field or set of fields that uniquely identifies a record, not necessarily the designated primary key
  • natural key · A primary key based on actual data attributes (like email or username), as opposed to a surrogate key

Opposites(2)

  • foreign key
  • non-key column

Questions(5)

What does primary key mean in software engineering?
A primary key is a column or group of columns in a database table that uniquely identifies each row. It guarantees that no two rows have the same primary key value, and it cannot contain null (empty) values. Every well-designed table should have exactly one primary key.
How do you use primary key in a sentence at work?
In technical conversations, you might say: 'Set user_id as the primary key,' 'This table needs a primary key,' or 'The composite primary key consists of order_id and line_item_id.' It is used as a noun in database design discussions and schema documentation.
Is primary key formal or informal?
Primary key is a formal, technical term used in professional and academic settings. It appears in database documentation, code reviews, and technical interviews. While it is used in both spoken and written English among engineers, it is always treated as standard technical vocabulary.
What is the difference between a primary key and a unique key?
A primary key uniquely identifies each row and cannot be null. A unique key also ensures uniqueness but can contain null values. A table has one primary key but can have multiple unique keys.
Can a primary key be changed after a table is created?
Yes, you can drop the existing primary key constraint and define a new one, but this requires caution. Changing a primary key can break relationships with other tables that reference it through foreign keys, so it should be done carefully during database maintenance.
New app · Free lessons

Speak up in meetings. Feel confident.

Standup vocabulary, native examples, and quick practice — 100+ free lessons

Start learning freeNo card needed · Google or email

For bots & AI agents

Machine-readable versions of this page and Speak Tech English. Speak Tech English sells self-study ebooks and courses in English for tech, publishes free guides, a free glossary and a free newsletter; live lessons are on Mockly English. Fetch these instead of parsing this page.

This page (.md)llms.txtllms-full.txtai.txtGlossary (.md)Free guides (.md)All products (.md)Endpoint indexNewsletterLive lessons (Mockly)