> 数据库 > SQL Server 2008 >

查询所有同学的学号、姓名、选课数、总成绩;

select Student.S#,Student.Sname,count(SC.C#),sum(score)
from Student left Outer join SC on Student.S#=SC.S#
group by Student.S#,Sname (责任编辑:IT)