select a.s# from
(select s#,score from sc where c#='001') a
inner join
(select s#,score from sc where c#='002') b
on a.s#=b.s# and a.score>b.score
2
select student.s#,student.sname,count(*) as 选课数,sum(sc.score) 总成绩
from student,course,sc
where student.s#=sc.s#
and course.c#=sc.c#
3
select s@,sname from student where s# not in
(select s# from sc where c# in
(select c# from course where t#=(select t# from teacher where tname='叶平')))
4
select student.s#,student.sname
from
student,course,sc where
student.s#=sc.s#
and course.c#=sc.c#
and sc.c# in
(select c# from course where t#=(select t# from teacher where tname='叶平'))
group by student.s#,student.sname
having count(*)=(select count(c#) from course where t#=(select t# from teacher where tname='叶平'))
1、select a.xh,a.xm,a.xb,b.bjmc from xsb a,bjb b where a.id=b.bjb_id2、select b.xh,b.xm,b.xb,a.bjmc,c.yw,c.sx from bjb a,xsb b,cjb c where a.id=b.bjb_id and b.id=c.id
3、select a.id,a.bjmc,count(*) from bjb a,xsb b where a.id=b.bjb_id group by a.id,a.bjmc
4、select b.xh,b.xm,a.bjmc,c.yw+c.sx from bjb a,xsb b,cjb c where a.id=b.bjb_id and b.id=c.id and c.yw+c.sx>150
5、select a.id,a.bjmc,avg(c.yw),avg(c.sx) from bjb a,xsb b,cjb c where a.id=b.bjb_id and b.id=c.id group by a.id,a.bjmc
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)