🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Databases Beginner

What is Primary Key?

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

A primary key ensures every row in a table is unique and identifiable. It cannot contain NULL values and must be unique across all rows. Common choices include auto-incrementing integers (SERIAL) or UUIDs.

Primary keys are automatically indexed for fast lookups. Composite primary keys use multiple columns together. Primary keys are referenced by foreign keys in other tables to create relationships.

Related Terms

CTE (Common Table Expression)
A temporary named result set defined within a SQL statement using the WITH clause, improving query readability and enabling recursion.
Window Function
An SQL function that performs calculations across a set of rows related to the current row without collapsing the result set.
Foreign Key
A column that creates a link between two tables by referencing the primary key of another table.
Index
A data structure that improves the speed of data retrieval operations on database tables at the cost of additional storage.
Graph Database
A database that uses graph structures with nodes, edges, and properties to store and query highly connected data.
Database Proxy
A middleware server that sits between applications and databases, providing connection pooling, load balancing, and query routing.
View All Databases Terms →