MySQL查询笔试综合题练习

题目要求:

在某个数据库下建表:

create table stu(
-> name char(3) not null default '',
-> subject varchar(10) not null default '',
-> score tinyint unsigned not null default 0
-> )charset utf8;

插入数据:

insert into stu values ('张三', '数学', 90);

......

查询:

select name,avg(score) as '平均' from stu group by name having sum(score < 60) >= 2;

原文地址:https://www.cnblogs.com/lqcdsns/p/6706632.html