MySQL Key值pri uni 和mul,以及extra中的auto-increment

论坛 期权论坛 编程之家     
选择匿名的用户   2021-5-22 23:11   11   0

pri 表示主键,唯一 在新建表时加上primary key

例如: id bigint(20) unsigned primary key not null

uni 表示唯一 在新建表时加上unique

例如: id bigint(20) unsigned UNIQUE default NULL

mul 可以重复,添加了索引

CREATE INDEX index_name ON table_name (column_name)

pri>uni>mul


auto-increment就是自动增加的意思,比如id自动增加。

例如: id bigint(20) unsigned auto-increment primary key not null

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP