MySql数据库设置主键
在创建表时添加主键
设置主键的关键字primary key
第一种
create table tests(
tid int(11) not null auto_increment, //not null是设置该字段不能为null;auto_increment设置该字段自增长
tname varchar(255) default null, //default设置该字段的默认值
primary key(tid)
)
第二种
create table users(
uid int(11)
原创
2020-12-28 21:48:22 ·
4882 阅读 ·
0 评论