通过alter table来创建索引,要注意区分三种索引
1.key:普通索引,可有重复值,等同于index
2.unique:无重复值的索引,可有null
3.primary key:主键,无重复值的索引,无null
alter table actor
add unique uniq_idx_firstname(first_name),
add key idx_lastname(last_name)
通过alter table来创建索引,要注意区分三种索引
1.key:普通索引,可有重复值,等同于index
2.unique:无重复值的索引,可有null
3.primary key:主键,无重复值的索引,无null
alter table actor
add unique uniq_idx_firstname(first_name),
add key idx_lastname(last_name)