赞
踩
12.查询和"01"号的同学学习的课程完全相同的其他同学的学号和姓名
select stu.sid,count(cid)13.查询两门及其以上不及格课程的同学的学号,姓名及其平均成绩
select sid,count(score) c,round(avg(score),1) from sc where score<60 group by sid having c>=2;
14.检索"01"课程分数小于60,按分数降序排列的学生信息
select sid,score s from sc where cid=01 and score<60 order by s desc;
order by avg desc;
on c.cid=course.cid;
) t;
order by c.avg desc;
20.查询出只选修了一门课程的全部学生的学号和姓名
select sid,count(cid) from sc group by sid having count(cid)=1;Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。