Primary-key Constraint

A primary key is a field in a table which uniquely identifies each record in a database table. Primary keys must contain unique values. A primary key column cannot have NULL values.

A table can have only one primary key, which may consist of column level or Table level. When in table level we use multiple fields are used as a primary key, they are called a composite key.

Primary key is a combination not null and unique constraint.

A table can have only one primary key.

examples:-

Advertisements