MySQL Unique

Distinct values.

MySQL 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.

However, you can have many UNIQUE constraints per table, but only one PRIMARY KEY constraint per table.

Example

CREATE TABLE Persons (ID int NOT NULL, LastName varchar(255) NOT NULL, UNIQUE (ID));