A unique constraint is used to ensure that a singular value occur only once in a column or that a distinctive combination of values occur only once across a series of columns.
Primary keys are themselves unique constraints automatically and can’t be created as unique constraints. Oracle does not permit you to create both a primary key and unique constraint with the same columns.
CREATE TABLE my_table
(my_column datatype default null/not null,
my_column datatype default null/not null,
CONSTRAINT my_constraint UNIQUE (column1, column2, …column_n)
);
Null values are allowed in a unique constraint, provided that the combination of values is unique.