题解 | #对first_name创建唯一索引uniq_idx_firstname#
对first_name创建唯一索引uniq_idx_firstname
http://www.nowcoder.com/practice/e1824daa0c49404aa602cf0cb34bdd75
#alter table 表名 add(unique) index 索引名(列名)
#创建唯一索引
ALTER table actor add unique index uniq_idx_firstname(first_name);
#创建普通索引
ALTER table actor add index idx_lastname(last_name);
# create (unique) index 索引名 on 表名(列名)
#创建唯一索引
create unique index uniq_idx_firstname on actor(first_name);
#创建普通索引
create index idx_lastname on actor(last_name)
查看10道真题和解析