2018-10-18
閱讀量:
5196
mysql創(chuàng)建索引有哪些?
>>用于數(shù)據(jù)比較多的時候;唯一性;會隨數(shù)據(jù)增加而變化
創(chuàng)建表時創(chuàng)建索引
語法:create table 表名(屬性名 數(shù)據(jù)類型 [完整性約束條件], ............. [unique | fulltext | spatial]
index | key[別名](屬性名 1[(長度)] [asc | desc]))
1、創(chuàng)建普通索引>>create table index1(id int,name varchar(20),index(id));
2、創(chuàng)建唯一索引>>create table index2(id int,name varchar(20),unique index index2_id(id asc));
3、創(chuàng)建全文索引>>create table index3(id int,name varchar(20),info varchar(20),fulltext index index3_info(info));
4、創(chuàng)建單列索引>>語法:.....index(id),....
5、創(chuàng)建多列索引>>語法:........index(id,name)......
刪除索引>>drop index 索引名 on 表名;






評論(0)


暫無數(shù)據(jù)
推薦帖子
0條評論
0條評論
0條評論
0條評論