O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

UNIQUE index

If you want the index to be unique, you can specify the keyword UNIQUE. For example:

mysql> ALTER TABLE employees ADD UNIQUE INDEX unique_name (last_name, first_name);# There are few duplicate entries in employees database, the above statement is shown for illustration purpose only.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required