Escolar Documentos
Profissional Documentos
Cultura Documentos
ALTER TABLE tbl_name ADD PRIMARY KEY (column_l !t": This statement adds a PRIMARY KEY, hi!h means that indexed "alues must be uni#ue and !annot be $%&&' ALTER TABLE tbl_name ADD #NI$#E nde%_name (column_l !t": This statement !reates an index for hi!h "alues must be uni#ue ( ith the ex!eption of $%&& "alues, hi!h may appear multiple times)' ALTER TABLE tbl_name ADD INDEX nde%_name (column_l !t": This adds an ordinary index in hi!h any "alue may appear more than on!e' ALTER TABLE tbl_name ADD &#LLTEXT nde%_name (column_l !t": This !reates a spe!ial *%&&TE+T index that is used for text,sear!hing purposes'
You !an drop any I$.E+ by using .R/P !lause along ith A&TER !ommand' Try out the follo ing example to drop abo"e,!reated index'
mysql> ALTER TABLE testalter_tbl DROP INDEX (c);
You !an drop any I$.E+ by using .R/P !lause along ith A&TER !ommand' Try out the follo ing example to drop abo"e,!reated index'
To drop an index that is not a PRIMARY KEY, you must spe!ify the index name'