|
本帖最后由 午夜洗衣机 于 2014-5-15 22:31 编辑
向老师,怎么每一题都没有子查询或者联合查询的?
交作业:- 2 select StuId,avg(Score) as AvgScore from [tblScore$] group by StuId having avg(Score)>60
- 4 select count(TeaName) as Mrli_count from [tblTeacher$] where TeaName like "李%"
- 13 select CourseID as 课程,Max(Score) as 最高分,min(Score) as 最低分 from [tblScore$] group by CourseID
- 19 select Stusex,count(Stusex) as StuSex_count from [tblStudent$] group by Stusex
- 20 select StuName,count(StuName) as Stu_Count from [tblStudent$] group by StuName having count(StuName&Stusex)>1
- 21 select CourseId,Avg(Score) as Score_Avg from [tblScore$] group by CourseId order by Avg(Score),CourseId desc
- 32 select StuId from [tblScore$] group by StuId having count(StuId&CourseId)>1
- 34 select StuId,CourseId,Score from [tblScore$] where CourseId="004" and Score<60 order by Score desc
复制代码 第32题我自己加了一个子查询,查询至少选修两门课程的学生学号和姓名:- select StuId,StuName from [tblStudent$] where StuId in(select StuId from [tblScore$] group by StuId having count(StuId&CourseId)>1) group by StuId,StuName
复制代码 |
评分
-
查看全部评分
|