练习表
CREATE TABLE `student` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '学号',
`createDate` datetime DEFAULT NULL COMMENT '创建时间',
`userName` varchar(20) DEFAULT NULL COMMENT '姓名',
`pwd` varchar(36) DEFAULT NULL COMMENT '密码',
`phone` varchar(11) DEFAULT NULL COMMENT '手机号',
`age` tinyint(3) unsigned DEFAULT NULL COMMENT '年龄',
`sex` char(2) DEFAULT NULL COMMENT '性别',
`introduce` varchar(255) DEFAULT NULL COMMENT '简介',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;
具体内容
select * from student where introduce like '%。';
select *from student where pwd is null;
select * from student where age between 150 and 200;
select * from student where createDate between '2024-02-20 00:00:00' and '2024-02-24 11:00:00';
select * from student where createDate > '2024-02-20 00:00:00' and '2024-02-24 11:00:00';
select * from student where userName in ('女娲','蚩尤','伏羲');
select * from student where userName not in ('女娲','蚩尤','伏羲');
标签:COMMENT,00,DEFAULT,练习,student,MySQL,操作,NULL,select
From: https://blog.csdn.net/Y123chang/article/details/137101805