MySQL SQL - How To Get a List of Indexes of an Existing Table
Interview Question Database For Software Developers
|
|
| How To Get a List of Indexes of an Existing Table | | How To Get a List of Indexes of an Existing Table? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements | | By: FYIcenter.com | If you want to see the index you have just created for an existing table,
you can use the "SHOW INDEX FROM tableName" command to get a list of all indexes
in a given table. The tutorial script below shows you a nice example:
mysql> SHOW INDEX FROM TIP;
+------------+-------------+--------------+-------------+...
| Non_unique | Key_name | Seq_in_index | Column_name |...
+------------+-------------+--------------+-------------+...
| 0 | PRIMARY | 1 | id |...
| 1 | tip_subject | 1 | subject |...
+------------+-------------+--------------+-------------+...
2 rows in set (0.03 sec)
It's interesting to see that there is a default index for the primary key column.
| | ID: 1092 | Rank: 1050 | Votes: 0 | Views: 22 | Submitted: 20070511 |
1047 :-) | | How To Drop an Existing Table | | How To Drop an Existing Table? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements... | | Submitted: 20070511 |
|
1048 :-) | | How To Create a Table Index | | How To Create a Table Index? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements... | | Submitted: 20070511 |
|
1048 :-) | | How To Drop an Existing Index | | How To Drop an Existing Index? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements... | | Submitted: 20070511 |
|
1046 :-) | | How To Create a New View | | How To Create a New View? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements... | | Submitted: 20070511 |
|
Copyright © 2009 FYIcenter.com
All rights in the contents of this Website are reserved by the individual author.
No part of the contents may be reproduced in any form without author's permission.
|
|
|