Last answered:

10 Apr 2023

Posted on:

27 Mar 2023

0

Resolved: Use of Index for removal of UNIQUE KEY

Why you had use the index for dropping Unique key? Is there Any other way to drop Unique Key?

1 answers ( 1 marked as helpful)
Instructor
Posted on:

10 Apr 2023

1

Hi Shashank!
Thanks for reaching out.


This is because the UNIQUE KEY constraint is an index. So, we have to use the following syntax:

ALTER TABLE table_name

DROP INDEX key_name;

You can use the following command to see the indexes of a particular table:

SHOW INDEX FROM <table_name>


Hope this helps.
Best,
Tsvetelin

Submit an answer