![]()
use stu
--1
select sno,cno,grade
from sc
where sno in (
select sno
from student
where sdept = 'CS'
)
--2
select cno
from course
where cno in(
select cno
from sc
where sno in ( select sno from student where sname='李勇')
)
--3
select sno
from student
where sno in (select sno from sc where cno='1') And sno in(select sno from sc where cno='2')
--4
select sno,sname
from student
where sno not in (select sno from sc)
--5
select sno,grade
from sc
where cno in(select cno from course where cname='数据库')
--6
select cno,grade
from sc
where grade >= ALL(select grade from sc where sno = '201215121')
--7
select sum(grade)
from sc
where sno in (select sno from student where sdept='CS') and cno = (select cno from course where cname='信息系统')
--8
select sno,grade
from sc
where sno in (select sno from student where sname='李勇') and cno = (select cno from course where cname='数据库')
--9
select cno,cname
from course
where cno not in (select cno from sc where sno='201215121')
--10
select sno,sname,sdept
from student
where sno in (select sno from sc group by sno having count(cno)>=2)