From the course: MySQL Advanced Topics (2019)

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Dropping indexes

Dropping indexes

- If you no longer need an index, you may remove it from the database with the drop index statement. Here again were going to use the scratch database. I'm going to go ahead and execute that, so we are using scratch. I'm going to describe customer, and when I execute that, we get a description of the customer table. You can see all of its columns and see that there is a primary key on the ID column. If I say show index from customer, I get this one index and its the primary key. If I want to create another index. I can say create index and I'll call it customer zip on the customer table, and the zip column. After that say show index from customer. When I execute both of these statements, my customer table now has two indexes, and one of them here is called custzip and is on the zip column, just as I specified it there in my create index statement. If I want to, I can drop this index. I can say drop index and name…

Contents