创建索引:
(1)ALTER TABLE table_name ADD INDEX index_name (name) //普通索引
(2)ALTER TABLE table_name ADD UNIQUE (name) //联合索引
(3)ALTER TABLE table_name ADD PRIMARY KEY (name) //主键索引
查看索引:
(1)show index from tblname;
(2)show keys from tblname;
删除索引:
(1)DROP INDEX index_name ON talbe_name
(2)ALTER TABLE table_name DROP INDEX index_name
(3)ALTER TABLE table_name DROP PRIMARY KEY
最后
以上就是勤劳柚子最近收集整理的关于数据库如何创建索引,查看索引,删除索引的全部内容,更多相关数据库如何创建索引内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复