学生信息:
CREATE TABLE `student` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '学号',
`creasteDate` datetime DEFAULT NULL,
`userName` varchar(20) DEFAULT NULL,
`pwd` varchar(36) DEFAULT NULL,
`phone` varchar(11) DEFAULT NULL,
`age` tinyint(3) DEFAULT NULL,
`sec` char(2) DEFAULT NULL,
`introduce` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
插入学生信息:
insert into student values(0,'2024-02-25 10:10:10','赵灵儿','123','15612345678',16,'女','逍遥哥哥');
insert into student values(0,'2024-02-25 10:10:10','逍遥哥','123','15612345678',26,'男','灵儿妹妹');
insert into student values(0,'2024-02-25 10:10:10','海柱','123','15612345678',3,'男','wcnm');
insert into student values(0,'2024-02-25 10:10:10','耀阳','123','15612345678',26,'男','nizaigoujiaoshenmo');
insert into student values(0,'2024-02-25 10:10:10','胡桃','123','15612345678',18,'女','吃饱喝饱,一路走好。');
select * from student;
insert into student (userName,age,introduce)values('刻晴',20,'斩尽芜杂');
select * from student ;
select userName as 姓名,age '年龄',sex '性别',introduce '简介' from student
where pwd is not null;
select * from student limit 3,2;
select * from student order by age desc limit 3;
select distinct sex '性别类型' from student;