1. select student.sno,cno,score from student,sc where student.sno=sc.sno
2. select Student.sname,Course.cname,SC.score
from Student,Course,SC where Student.sno=SC.sno
and Course.cno=SC.cno
and SC.cno='01001'
and SC.score not between 70 and 90
3. select st.sname,s.cno,s.score from student st,sc s where st.sno=s.sno
4. select second.sno,second.sname,second,sage
from student first,student second
where first.sname='王红'and second.sage>first.sage
5. select course.cname,sc.*from course course right outer join sc on(course.cno=sc.cno)
6 select sname,sbir from student where sage=
(select sage from student where sname='张维明')and sname <>'张维明'
7. select sno ,sname from student where sno in(select sno from sc
where cno=(select cno from course where cname='计算机网络'))
8. select sno,sname from student
where sage>any(select sage from student where clno='200801')and clno<>'200801'
9. select sno,sname from student
where sage>all(select sage from student where clno='200801')and clno<>'200801'
10. select sno,sname from student
where exists(select * from sc where sc.sno=student.sno and cno='02002')
11. select sno,sname from student
where sage=(select sage from student where sname='李静')
and clno=(select clno from student where sname='李静')
and sname<>'李静'
12. select *from student
where Clno=(select Clno from student
where sname='王一夫')
and sage>(select asge from student
where sname='赵良明')and sname<>'王一夫'
13. select cname from Course where Cno in(
select cno
from sc
group by cno
having COUNT(*)>3)
14. select sno from sc
where cno='01001'
union
select sno from sc
where cno='02002'
15. select sname,student.sno
from student
where sno in
(
select distinct sc.sno
from sc
where sc.sno=student.sno
and sc.sno not in
(
select sc.sno
from sc
where cno='02003'
)
)
16. select sname from student
where not exists
(select * from Course
where not exists
(select * from SC
where SC.Sno=student.Sno and SC.Cno=Course.cno))
17. select distinct sno from
sc scx where not exists
(select * from sc scy where scy.sno='20080102'
and not exists
(select * from sc scz
where scz.sno=scx.sno and scz.cno=scy.cno))and
scx.sno<>'20080102'
18. select *from sc x
where score>(select avg(select中distinctscore) from sc y
where y.sno=x.sno)
19. select sname,sno from student where
not exists(select * from sc where sno=student.sno)

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。