UNIQUE
UNIQUE is a SQL statement in the Constraints category. Ensures all values in a column (or combination) are unique across the table. Allows NULLs (multiple NULLs allowed). The syntax is column type UNIQUE / CONSTRAINT uq_name UNIQUE (col1, col2). It returns constraint. A typical example: CREATE TABLE users (email VARCHAR(255) UNIQUE); -- Two users cannot have the same email CREATE TABLE products (cat_id INT, sku VARCHAR(50), UNIQUE (cat_id, sku)); A close relative is PRIMARY KEY, which a column or set of columns that uniquely identifies each row. Only one PK per table. Automatically creates a unique index. A close relative is FOREIGN KEY, which ensures referential integrity: values in this column must exist in the referenced parent table. A close relative is NOT NULL, which ensures a column cannot contain NULL values. More about this category: Table constraints — PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL, CHECK, DEFAULT.