SQL Alter Table Indexes.
Creating Indexes with the ALTER TABLE statement.
In some RDBMS you can create indexes with the ALTER TABLE statement.Syntax:
MySQL:
ALTER TABLE table_name
ADD [UNIQUE] INDEX constraint_name (column_name, ....),
ADD [UNIQUE] INDEX constraint_name (column_name, ....), .....;
Add Index example:
ALTER TABLE BOOKSTORE
ADD INDEX SHORT_IND (SHORT_DESC),
ADD INDEX ISNB_AUTHOR_IND (ISBN_NO, AUTHOR);
Add Unique Index example:
ALTER TABLE BOOKSTORE
ADD UNIQUE INDEX SHORTDESC_IND (SHORT_DESC, PUBLISHER),
ADD UNIQUE INDEX AUTHOR_IND (AUTHOR);
© 2010 by Finnesand Data.
All rights reserved.
This site aims to provide FREE programming training and technics.
Finnesand Data as site owner gives no warranty for the
correctness in the pages or source codes.
The risk of using this web-site pages or any program
codes from this website is entirely at the individual user.