题解 | #对first_name创建唯一索引uniq_idx_firstname#
对first_name创建唯一索引uniq_idx_firstname
http://www.nowcoder.com/practice/e1824daa0c49404aa602cf0cb34bdd75
在Create table的时候创建索引
主要是想记录一下,在create table的时候如何创建索引
[unique] index index_name(column)
DROP table actor; CREATE TABLE actor ( actor_id smallint(5) NOT NULL PRIMARY KEY, first_name varchar(45) NOT NULL , last_name varchar(45) NOT NULL, last_update datetime NOT NULL, index idx_lastname(last_name), UNIQUE index uniq_idx_firstname(first_name) );