Databases databases sql

What is Primary Key?

Definition

A primary key is a column (or set of columns) in a database table that uniquely identifies each row. Primary keys must be unique and not null. Common choices are auto-incrementing integers and UUIDs.

Why It Matters

Primary keys are fundamental to relational database design. They enable efficient lookups, define relationships between tables (foreign keys), and ensure data integrity. Choosing the right primary key type (integer vs UUID) affects performance and scalability.

Related Free Tools

Related Terms