faqts : Computers : Databases : MySQL : Language and Syntax : Queries : Show

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

7 of 8 people (88%) answered Yes
Recently 4 of 5 people (80%) answered Yes

Entry

How can I see all the indexes for a table?
How can I see all keys for a table?
What is the name of the INDEX for the PRIMARY KEY of a table?
What is the name of a key placed on a single column?

May 18th, 2000 06:33
Nathan Wallace, Steve Ruby, Thimble Smith


The name of the primary key is PRIMARY.

A key on a single column is named after the column.

If you want to know what the keys are called you should issue

    show keys from <tablename>;

It will provide what columns are in the keys and what they are named.

You can also try:

    SHOW INDEXES FROM table_name;