From the course: MySQL Advanced Topics

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Dropping indexes

Dropping indexes

- [Bill] Hi, I am Bill Weinman. If you no longer need an index, you may remove it from the table with the drop index statement. So we'll use scratch for this lesson. And I'll start by looking at the customer table with the describe statement. And we see here a list of all of the columns in the customer table. And you notice that the ID column is the primary key. We can see this also with the show index statement. And there's our primary key and all of the information about it. If I want to create an additional index, I can say create index. And we'll call it customer zip, c-u-s-t-zip, custzip. On customer and the zip column. And that creates that index. We can do the show index statement again, and you can see there's our additional index. And if I no longer need that index, I can remove it from the table with the drop index statement. I specify the name of the index and the table. And that will drop that index, it'll remove that index from the table, and we can look at show index…

Contents