简陋版
CREATE TABLE `students` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`createDate` datetime DEFAULT NULL,
`userName` varchar(20) DEFAULT NULL,
`pwd` varchar(36) DEFAULT NULL,
`phone` varchar(11) DEFAULT NULL,
`age` tinyint(3) DEFAULT NULL,
`sex` char(2) DEFAULT NULL,
`introduce` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into students values(0,'2024-02-25 10:00:00','陈小鑫','123465','12345678911',18,'女',
'立志做324最bt的人');
insert into students values(0,'2024-02-25 10:00:00','侯小康','123456','14785236900',19,'女',
'324最柔弱温婉的女子');
insert into students values(0,'2024-02-25 10:00:00','程小豪','123654','14562398798',18,'男',
'在324变态之家不改初心的意志坚挺之人');
insert into students values(0,'2024-02-25 10:00:00','白小兴','666666','15236478998',19,'男',
'在324变态之中都是及其强悍的变态');
insert into students values(0,'2024-02-25 10:00:00','侯小卓','444455','12345698798',18,'男',
'安安静静的默默变态');
insert into students values(0,'2024-02-25 10:00:00','崔小森','333333','15632478999',19,'男',
'太变态了,实力不详');
select*from students;
select userName,age,sex
from students
where pwd is not null;
select distinct sex '性别类型' from students;
select userName as '姓名',age,sex'性别' from students ORDER BY age desc;