?檢索選修課程包含LIU老師所授課程的學生學號
select sno
from sc
where cno in
(select cno
from c
where tname='LIU')
?檢索選修課程包含LIU老師所授全部課程的學生學號
select distinct sno
from sc X
where not exists
(select *
from sc y
where cno in
? (select cno
? from c
? where tname='LIU')
? and not exists
? (select *
? from sc z
? where z.sno=x.sno and z.cno=x.cno)
)
■求LIU老師所授課程的每門課程的學生平均成績
select sc.cno,AVG(grade)
from sc,c
where sc.cno=c.cno
and tname='LIU'
group by sc.cno