SQL-37 创建索引

时间:2019-04-18 10:14:24   收藏:0   阅读:108

题目描述

针对如下表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
SQL:
create unique index uniq_idx_firstname on actor(first_name);
create index idx_lastname on actor(last_name);

  

原文:https://www.cnblogs.com/kexiblog/p/10727448.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!