【正确答案】select sno,sum(grade)总成绩,avg(grade)平均成绩,count(*) 选课门数 from sc group by sno having count(*)>2
【答案解析】
【正确答案】select sno,sum(grade) 总成绩 from sc group by sno having sum(grade)>200
【答案解析】
【正确答案】select sname,sdept from Student join SC on Student.Sno=SC.Sno where cno='C02'
【答案解析】
【正确答案】select sname,cno,grade from student s join sc on s.sno=sc.sno where grade>80 Order by grade desc
【答案解析】
【正确答案】select sname,ssex,grade from student s join sc on s.sno=sc.sno join course c on c.cno=sc.cno where sdept='计算机系' and ssex='男' and cname='数据库基础'
【答案解析】
【正确答案】select s.sno,sname,cno,grade from Student s left join SC on s.Sno=SC.Sno
【答案解析】
【正确答案】select top 3 s.sno,sname,sdept,grade from Student s join SC on s.Sno=SC.Sno join Course c on c.Cno= SC.Cno where cname='数据库基础' order by grade desc
【答案解析】
【正确答案】select t1.sno,t2.sno,t1.cno from sc as t1 join.sc as t2 on t1.cno=t2.cno where tl.sno<t2.sno
【答案解析】
【正确答案】select c.cno,cname from course c left join sc on c.cno=sc.cno where sc.cno is null
【答案解析】
【正确答案】select sname,cname,grade from student S join sc on s.sno=sc.sno jom course c on c.cno=sc.cno where sdept='计算机系' and grade>(select avg(grade) from sc)
【答案解析】
【正确答案】select sname,sdept,grade from student s join sc on s.sno=sc.sno jom course C on c.cno=sc.cno where grade=( select min(grade) from sc where cno in ( select cno from course where cname='vb')) and cname='vb'
【答案解析】
【正确答案】select s.sno 学号,sname 姓名, case sdept when '计算机系' then 'CS' when '信息系' then 'IS' when '数学系' then 'MA' else 'OTHER' end as 所在系,grade 成绩 from student s join sc on s.sno=sc.sno join course c on c.cno=sc.cno where cname='vb'
【答案解析】
【正确答案】select c.cno, case when count(sc.cno)>100 then '人多' when count(sc.cno) between 40 and 100 then'一般' when count(c.cno)<40 then '较少' when count(sc.cno)=0 then '无人选' end as 选课人数 from sc right join course c on sc.cno=c.cno group by c.cno