In MySQL, a UNIQUE
constraint is a constraint type that ensures that all values in a column or a group of columns are distinct from each other. In other words, all values that go into the column or group of columns must be unique.
UNIQUE
constraints can be applied whenever we want to prevent duplicate entries in specific columns without making them a primary key.