主键索引,这意味着索引值必须是唯一的,且不能为null。
alter table 表名 add primary key (加索引的字段)
建索引的值必须是唯一的(除了null外,null可以出现多次)。
alter table 表名 add unique 索引名 (加索引的字段)
添加普通索引,索引值可出现多次
alter table 表名 add index 索引名 (加索引的字段)
添加组合索引
alter table 表名 add index 索引名 (加索引的字段,加索引的字段,加索引的字段,等等....)