UNIQUE Keyword
The UNIQUE keyword or constraint is used to ensure that all values in a column are unique.
SQL UNIQUE ON CREATE TABLE
SQL
CREATE TABLE <TABLE_NAME> (
<COLUMN_NAME> DATATYPE UNIQUE
);Example
SQL
CREATE TABLE Employee (
EMP_NO Integer UNIQUE
);SQL UNIQUE ON ALTER TABLE
SQL
ALTER TABLE <TABLE_NAME>
ADD UNIQUE (<COLUMN_NAME>);Example
SQL
ALTER TABLE Employee ADD UNIQUE(EMP_NO);Summary
The UNIQUE constraint makes sure that each value in a column is distinct.

Join the conversation! Your thoughts help the community grow.