MySQL 创建索引(Create Index)的方法和语法结构及例子
create index syntax
create [unique|fulltext|spatial] index index_name
[index_type]
on tbl_name (index_col_name,...)
[index_type]
index_col_name:
col_name [(length)] [asc | desc]
index_type:
using {btree | hash | rtree}
-- 创建无索引的表格
create table testnopk (
id int not null,
name varchar(10)
);
-- 创建普通索引
create index idx_testnopk_name on testnopk (name);
如对本文有疑问,
点击进行留言回复!!
网友评论