A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Types of Constraints

A Unique Constraint
A Unique Constraint

The UNIQUE constraint ensures that all values in a column are different. Both the UNIQUE and PRIMARY KEY constraints provide a guarantee for uniqueness for a column or set of columns. A PRIMARY KEY constraint automatically has a UNIQUE constraint.

source: w3schools.com
FOREIGN KEY
FOREIGN KEY

SQL FOREIGN KEY Constraint A FOREIGN KEY is a key used to link two tables together. A FOREIGN KEY is a field (or collection of fields) in one table that refers to the PRIMARY KEY in another table.

source: w3schools.com
NOT NULL
NOT NULL

SQL NOT NULL Constraint. By default, a column can hold NULL values. The NOT NULL constraint enforces a column to NOT accept NULL values. This enforces a field to always contain a value, which means that you cannot insert a new record, or update a record without adding a value to this field.

source: w3schools.com
PRIMARY KEY
PRIMARY KEY

Primary Key Constraints. Foreign Key Constraints. Related Tasks. Primary Key Constraints. A table typically has a column or combination of columns that contain values that uniquely identify each row in the table. This column, or columns, is called the primary key (PK) of the table and enforces the entity integrity of the table.

Related Types