select s.sname as 姓名,sc.grade as 分数
from s,sc
where s.sno=sc.sno --内链接
and s.sno in
(
select distinct(sc.cno)
from sc
where sc.cno in ( select s.no --所学的课程中一定要有程军老师教的课程
from s
where s.teacher='程军'
)
group by sc.sno
having count(sc.cno)>=(select count ( distinct s.no)--课程数大于等于程军老师所教课程数
from s
where s.teacher='程军‘
)
)
如果还有问题,请追问。
望采纳!