🎁 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

Schema
The structure definition of a database including tables, columns, data types, relationships, indexes, and constraints.
Query Optimization
The process of improving database query performance through indexing, query rewriting, and schema design techniques.
Trigger
A database object that automatically executes a specified function when certain events (INSERT, UPDATE, DELETE) occur on a table.
Replication
The process of copying and maintaining database data across multiple servers for redundancy, failover, and read scaling.
JSONB
PostgreSQL's binary JSON data type that stores JSON documents with indexing, querying, and manipulation capabilities.
Soft Delete
A pattern where records are marked as deleted with a flag or timestamp rather than being physically removed from the database.
View All Databases Terms →