Syntax for creating and altering indexes

To see what index a query has, you can use the following sample syntax: 

EXPLAIN SELECT statement;  

To create an index, you can use the following sample syntax: 

ALTER TABLE tablename
ADD INDEX indexname (columnnames);

To change an index in MySQL, you need to drop it and then add it back again using the following sample syntax: 

ALTER TABLE tablename 
DROP INDEX indexname;
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.27.45