题解 | #对first_name创建唯一索引uniq_idx_firstname#

对first_name创建唯一索引uniq_idx_firstname

http://www.nowcoder.com/practice/e1824daa0c49404aa602cf0cb34bdd75

通过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)

全部评论

相关推荐

点赞 评论 收藏
分享
水墨不写bug:疑似没有上过大学
点赞 评论 收藏
分享
07-14 13:47
门头沟学院 Java
Lynn012:你评估好自己的位置了吗《顶尖应届》
投递小米集团等公司8个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务