题目要求:

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);

......

MySQL查询笔试综合题练习

 

查询:

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

 

相关文章:

  • 2021-06-08
  • 2021-06-14
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2021-10-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-19
  • 2022-12-23
  • 2022-12-23
  • 2021-05-22
  • 2021-11-01
相关资源
相似解决方案