mysql add unique constraint code example
Example 1: how to add unique constraint in mysql table
ALTER TABLE mytbl ADD UNIQUE (columnName);
Example 2: mysql alter table set column unique
ALTER TABLE contacts
ADD CONSTRAINT contacts_unique UNIQUE (reference_number);
Example 3: set column as unique in sql server
ALTER TABLE Persons
ADD UNIQUE (ID);