Want to save your progress?
Create a free account to track your lessons and quizzes across devices.
Register Login
« Back to ClassCompleted: 50%

The World of Data - Introduction to Databases

Page 3 of 4


Unique Identifiers: The concept of a Primary Key

In a database table, it's essential to have a way to uniquely identify every single row. How can you be sure you are looking at the record for "John Smith" from Ohio versus the "John Smith" from California? This is solved by using a Primary Key.

A Primary Key is a special column (or set of columns) in a table whose value uniquely identifies each record in that table. It acts as a permanent, unique ID number for each row.

A primary key must follow two strict rules:

  1. It must be UNIQUE: No two rows in the same table can have the same primary key value.
  2. It cannot be NULL (empty): Every row must have a value for its primary key.

Example: In a Customers table, a column named CustomerID would be an excellent primary key. Even if two customers have the same name, their CustomerID (e.g., 101, 102, 103...) would be unique. This unique ID allows the database to retrieve, update, or delete a specific record with absolute certainty and is also used to create relationships between tables (e.g., linking a CustomerID in the Orders table back to the correct customer in the Customers table).