我现在有一个题.求大神帮忙解决下/1: 数据库表stu字段 id name course score

问题:查询出至少3门不及格的学生的姓名...createtablestu(idint,namevarchar(20),coursevarchar(40),scoreint... 问题: 查询出至少3门不及格的学生的姓名...
create table stu (id int ,name varchar(20),course varchar(40) ,score int ); 有以下数据:
insert into student values (1,'zhuhai','shuxue',80);
insert into student values (2,'zhuhai','jisuanjikexueyujishu',49);
insert into student values (3,'zhuhai','ruanjiangongcheng',59);
insert into student values (4,'zhuhai','yingyu',70);
insert into student values (5,'zhu','shuxue',80);
insert into student values (6,'zhu','jisuanjikexueyujishu',59);
insert into student values (7,'zhu','ruanjiangongcheng',40);
insert into student values (8,'zhu','yingyu',55);
insert into student values (9,'hai','shuxue',90);
insert into student values (10,'hai','jisuanjikexueyujishu',40);
insert into student values (11,'hai','ruanjiangongcheng',30);
insert into student values (12,'hai','yingyu',25);
insert into student values (13,'zhuhai1','shuxue',80);
insert into student values (14,'zhuhai1','jisuanjikexueyujishu',45);
insert into student values (15,'zhuhai1','ruanjiangongcheng',50);
insert into student values (16,'zhuhai1','yingyu',80);
insert into student values (17,'zhuhai2','shuxue',80);
insert into student values (18,'zhuhai2','jisuanjikexueyujishu',90);
insert into student values (19,'zhuhai2','ruanjiangongcheng',46);
insert into student values (20,'zhuhai2','yingyu',70);

求大神解决下我这个问题!
展开
 我来答
百度网友69c7c72
2013-03-20 · 超过19用户采纳过TA的回答
知道答主
回答量:53
采纳率:0%
帮助的人:49.4万
展开全部
select name from (select name,count(*) as sum from stu where score<60 group by name)t1 where t1.sum>=3;
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式