1.DDL语句
CREATE TABLE `student` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '学号',
`creatDate` datetime DEFAULT NULL,
`userName` varchar(20) DEFAULT NULL,
`pwd` varchar(36) DEFAULT NULL,
`phone` varchar(11) DEFAULT NULL,
`age` tinyint(3) unsigned DEFAULT NULL,
`sex` char(2) DEFAULT NULL,
`introduce` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
2.DML语句
insert into student values(0,'2024-3-26 10:10:10','女娲','123456','15212345678',255,'神','补天捏人');
insert into student values(0,'2024-3-26 10:10:10','神农','123456','15312345678',250,'神','尝百草');
insert into student values(0,'2024-3-26 10:10:10','盘古','123456','15112345678',255,'神','劈开混沌,头为天,脚为地');
insert into student values(0,'2024-3-26 10:10:10','祝融','123456','18212345678',210,'神','火神');
insert into student values(0,'2024-3-26 10:10:10','共工','123456','18312345678',210,'神','水神');
insert into student values(0,'2024-3-26 10:10:10','蚩尤','123456','14212345678',200,'神','蛮族首领');
insert into student values(0,'2024-3-26 10:10:10','伏羲','123456','12212345678',255,'神','先天八卦');
3.DQL语句,以及模糊查询(like between in and)
SELECT * FROM `student` where introduce like'%人%';
select * from student where pwd is null;
select * from student where pwd is not null;
select * from student where age between 150 and 200;
select * from student where userName in ('盘古','伏羲','蚩尤');
标签:10,26,insert,DEFAULT,DML,单表,student,MySQL,NULL
From: https://blog.csdn.net/yxy1367/article/details/137144012