Adding a unique index on multiple columns in MySQL, can make it easier to avoid duplicated content in a MySQL table.
One advantage of doing this, is that it works with the ON DUPLICATE KAY syntax, which will make it easier to query the database.
You can add a unique index with the ALTER TABLE command, like shown in the below example:
ALTER TABLE table_name ADD UNIQUE unique_index(column_1, column_2);
You can easily make it cover more columns by extending it with more commas, which can be done like:
ALTER TABLE table_name ADD UNIQUE unique_index(column_1, column_2, column_3);