Create a unique index using SQL statements in the following format: Create unique index name on table name (column name 1, column Name 2 ...) For example, create a unique index ix_goodsmade_labour on the SID column of table Goodsmade_labour, with the following code: Create unique index ix_goodsmade_labour on Goodsmade_ Labour (SID) creates a nonclustered index in such a case that it is the same as using the nonclustered key effect. Create unique nonclustered index ix_goodsmade_labour on goodsmade_labour (SID) If you are creating a clustered index, you can use the keyword clustered with the following code: Create Unique clustered index ix_goodsmade_labour on Goodsmade_labour (SID)
How to add several other commonly used indexes
1. Add primary key (primary key index) MySQL>
2. Add unique (unique index) MySQL>
3. Add index (normal index) MySQL>
4. Add fulltext (full-text index) MySQL>
5. Add multi-column index mysql>alter TABLE ' table_name ' Add index index_name (' Column1 ', ' column2 ', ' column3 ')
Create a unique index using SQL