Table Indexes MySQL Essential Training

Table Indexes MySQL Essential Training

MySQL

Table Indexes MySQL Essential Training




Welcome to another interesting lesson in MySQL Essential Training series. In our previous lesson we’ve seen the basics about the columns and its various functionalities. In this lesson we’re gonna look about Table Indexes MySQL Essential Training in a detail. At the end of the lesson we hope you have some basic knowledge about the indexes and its part in MySQL.
Indexes are nothing but a key to maintain the large amount of data with unique identifications. Using this indexes we can find a column or row very quickly from the vast area of data.
Create a Index
The process of creating a index for column or a table is create a column as like. Lets see how to create a index for our table in the following example.
Syntax: // Create a index for the column id.
CREATE INDEX index_name
ON table_name (column_name, …);
In the above we’ve a syntax for create a index. In this, it has a keyword Index and its name to assign a index for a column. In Table Indexes MySQL Essential Training lesson we can lets do this with an real time example.

Table Indexes MySQL Essential Training




In the above we successfully created a index named a for the column id. And lets see what happens after the index has been created. It doesn’t show anything in the output but it shows the logical output in the upcoming searches. We can check the created index by describe command.
Table Indexes MySQL Essential Training
Rename a Index
Renaming a index is a very rare process in a overall performance of a MySQL. In general the index is deleted or changes its definition. So if we wants to rename a index we’ve to drop that index and create a new index with the name we wants to rename. In this Table Indexes MySQL Essential Training lesson we don’t rename a index. So we drop or delete a index and create a new one.
Drop a Index
Like create an index, drop a index also very simple. Just mention the table name to drop a index to delete.
Syntax: Drop a index from the table called emp_details.
DROP INDEX index_name
ON table_name;
In the above it gives the syntax for drop index. And now lets see how to do that with a real example.

Table Indexes MySQL Essential Training
This is the method of delete or drop a index from the table. There is also another concept called identifiers related to the index which we can see in the upcoming lessons.
We hope this table indexes MySQL essential training lesson will gives you an basic idea about what is the index and its functionalities.




Leave a Reply