How to Create an Index in MySQL

To create an index you need to use the create index statement specifying the name of the table, the name of the index and the columns forming the index key. Additionally you can specify if the index allows duplicates or unique keys.

create unique index emp_ix1 on employee ( employee_id );

create duplicate index emp_ix2 on employee ( last_name, start_date );

IN THIS PAGE