37. 对first_name创建唯一索引uniq_idx_firstname

题目描述

针对如下表actor结构创建索引:
CREATE TABLE IF NOT EXISTS actor (
actor_id smallint(5) NOT NULL PRIMARY KEY,
first_name varchar(45) NOT NULL,
last_name varchar(45) NOT NULL,
last_update timestamp NOT NULL DEFAULT (datetime('now','localtime')))
对first_name创建唯一索引uniq_idx_firstname,对last_name创建普通索引idx_lastname

create unique index uniq_idx_firstname on actor(first_name);
create index idx_lastname on actor(last_name);

很奇怪,有时候某个地方多个空格就不能通过。。。

猜你喜欢

转载自blog.csdn.net/weixin_39605679/article/details/83106529
今日推荐