SQL Drop Index Syntax
SQL > ALTER TABLE >
Drop Index Syntax
Sometimes we may decide that a particular index is no longer needed for a table. In those cases, that index should be removed to free up storage. To drop an index in SQL, we specify that we want to change the table structure via the ALTER TABLE command, followed by the DROP INDEX command.
The SQL syntax to drop an index from a table is,
ALTER TABLE "table_name"
DROP INDEX "index_name";
Let's look at the example. Assuming our starting point is the Customer table created in the CREATE TABLE section:
Assume we want to drop the index created in the ALTER TABLE ADD INDEX section. To do this, we type in the following:
ALTER TABLE Customer DROP INDEX IDX_COUNTRY;
Please note that using ALTER TABLE to drop an index in supported in MySQL but not in Oracle or SQL Server.