Repaso
EspaƱol

What is a primary key?

Options

  1. The first column of every table that is created in a database
  2. A column (or columns) that uniquely identifies each row, never NULL (Correct option)
  3. The password that is used to protect access to the database
  4. The most important table of the whole schema of the database

Answer

A column (or set of columns) that uniquely identifies each row and can never be NULL

Why

Each row needs a unique ID so you can point to exactly that row: update it, delete it, or reference it from another table.

Typical primary keys: an auto-increment integer id or a UUID.

The database guarantees no two rows share the same primary key value.

Remember

Primary key = unique ID of each row.

Key terms

Practice this question in Repaso