Pages

SQL PRIMARY KEY Constraint

The PRIMARY KEY constraint is used to uniquely identify each row in a table. A PRIMARY KEY must contain unique values and it can’t contain a null value. A table can have only one primary key. We can use multiple columns or fields to define a primary key, such primary key is known as composite key.

Syntax of PRIMARY KEY Constraint on one column with CREATE TABLE statement: