mysql 增加主键脚本_下面是mysql的脚本文件,明明id是自动增长主键,不允许null,怎么还可以那样插入呢?脚本文件可以执行...

createdatabasebbs;usebbs;createtablearticle(idintprimarykeyauto_increment,pidint,rootidint,titlevarchar(255),conttext,pdatedatetime,isleafint#1-notleaf0-leaf);insertintoa...

create database bbs;

use bbs;

create table article

(

id int primary key auto_increment,

pid int,

rootid int,

title varchar(255),

cont text,

pdate datetime,

isleaf int #1-not leaf 0-leaf

);

insert into article values (null, 0, 1, '蚂蚁大战大象', '蚂蚁大战大象', now(), 1);

insert into article values (null, 1, 1, '大象被打趴下了', '大象被打趴下了',now(), 1);

insert into article values (null, 2, 1, '蚂蚁也不好过','蚂蚁也不好过', now(), 0);

insert into article values (null, 2, 1, '瞎说', '瞎说', now(), 1);

insert into article values (null, 4, 1, '没有瞎说', '没有瞎说', now(), 0);

insert into article values (null, 1, 1, '怎么可能', '怎么可能', now(), 1);

insert into article values (null, 6, 1, '怎么没有可能', '怎么没有可能', now(), 0);

insert into article values (null, 6, 1, '可能性是很大的', '可能性是很大的', now(), 0);

insert into article values (null, 2, 1, '大象进医院了', '大象进医院了', now(), 1);

insert into article values (null, 9, 1, '护士是蚂蚁', '护士是蚂蚁', now(), 0);

展开

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值