select s.*,a.grade as en,c.grade as ma
from s,sc a,sc b,c c,c d
where s.s# = a.s# and a.c# = b.c# and b.cname = '英语' and
s.s# = c.s# and c.c# = d.c# and d.cname = '数学' and
a.grade > c.grade
select sname from @s where s# in (select temp1.s# from (select AB.s#,AB.grade from @c A join @sc AB on A.c#=AB.c# where cname='英语') temp1
join (select AB.s#,AB.grade from @c A join @sc AB on A.c#=AB.c# where cname='数学') temp2
on temp1.s#=temp2.s# where temp1.grade>temp2.grade)