Like a primary index, a unique index does not permit to insert duplicate values into the respective field(s). However, the difference between primary index and unique index is that only one primary index is allowed per table, whereas multiple unique indexes are permitted. So all values in the indexed column(s) must occur once.
MySQL allows to designate multiple columns as unique in a given table. These indexes are the same as "Non-Unique" or "Normal" indexes with a restraint 'uniqueness in records'. To create unique index is simple as to create other MySQL indexes like non-unique or normal and primary index.
Unique Key or Index Related FAQs
|