好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

mysql创建单个和联合索引 - mysql数据库栏目 - 自学

首先创建一个表:create table t1 (id int primary key,username varchar(20),password varchar(20));

创建单个索引的语法:create index 索引名 on 表名(字段名)

索引名一般是:表名_字段名

给id创建索引:create index t1_id on t1(id);

创建联合索引的语法:create index 索引名 on 表名(字段名1,字段名2)

给username和password创建联合索引:create index t1_username_password on t1(username,password)

查看更多关于mysql创建单个和联合索引 - mysql数据库栏目 - 自学的详细内容...

  阅读:38次