select a.cno as '课程号', b.cname as '课程名称',c.sno as '学号',c.sname as '姓名',a.grade as '成绩',avg(a.grade) as '平均成绩',
(select AVG(grade) from SC where cno=b.cno) as '该科平均成绩',
round((select AVG(grade) from SC),2) as '所有科目平均成绩'
from SC a left join C b on a.cno=b.cno left join S c on a.sno=c.sno
GROUP BY b.cname,a.cno,c.sname,c.sno,a.grade,b.cno