how to define UNIQUE Constraint in mysql while creating table code example Example: how to add unique constraint in mysql table ALTER TABLE mytbl ADD UNIQUE (columnName);