DROPindexid_fname_lnameonemployee;QueryOK,0rowsaffected(0.30sec)Records:0Duplicates:0Warnings:0 It can be observed from the result set of the following query Deletion of UNIQUE index-mysql>showindexfromemployee;Emptyset(0"/> DROPindexid_fname_lnameonemployee;QueryOK,0rowsaffected(0.30sec)Records:0Duplicates:0Warnings:0 It can be observed from the result set of the following query Deletion of UNIQUE index-mysql>showindexfromemployee;Emptyset(0">

Home >Database >Mysql Tutorial >How do we drop a multi-column UNIQUE index?

How do we drop a multi-column UNIQUE index?

王林
王林forward
2023-09-05 14:25:021357browse

How do we drop a multi-column UNIQUE index?

Multi-column UNIQUE indexes can also be dropped just like we drop UNIQUE constraints from the table.

Example

In this example, we have deleted a multi-column UNIQUE index on the table "employee" using the following query -

mysql> DROP index id_fname_lname on employee;
Query OK, 0 rows affected (0.30 sec)
Records: 0 Duplicates: 0 Warnings: 0

It can be observed from the result set of the following query Deletion of UNIQUE index-

mysql> show index from employee;
Empty set (0.00 sec)

mysql> describe employee;
+------------+-------------+------+-----+---------+-------+
| Field      | Type        | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| empid      | int(11)     | YES  |     | NULL    |       |
| first_name | varchar(20) | YES  |     | NULL    |       |
| last_name  | varchar(20) | YES  |     | NULL    |       |
+------------+-------------+------+-----+---------+-------+
3 rows in set (0.08 sec)

The above is the detailed content of How do we drop a multi-column UNIQUE index?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete