Glossary · Database
Primary Key
A column or set of columns that uniquely identifies each row in a database table.
A primary key is a constraint that uniquely identifies each record in a database table. It must contain unique values and cannot contain NULL values. A table can have only one primary key, which may consist of a single column (simple key) or multiple columns (composite key). Primary keys serve as the main reference point for a record and are used by foreign keys in other tables to establish relationships. Common primary key strategies include auto-incrementing integers, UUIDs (Universally Unique Identifiers), and natural keys (meaningful values like email or ISBN). The choice of primary key impacts performance, scalability, and data distribution.
In practice
How AI for Database applies it
Fig — every answer ships with the tables, rows and SQL behind it.
Related terms
See it on your own database
Connect read-only in minutes. Free models included.