用SQL语言查询每门课程得最高分的学生学号,课程号,成绩.查询结果按课程号升序排列
1个回答
展开全部
--1
select * from SC A where grade=(select MAX(grade) from SC B where A.Cno=B.Cno)
order by Cno
--2
select S.Sno,Sname,SUM(Grade) 总分
from S join SC on S.Sno=SC.Sno
group by S.Sno,Sname
having COUNT(*)=(select COUNT(*) from C)
--3
insert into SC_C
select C.Cno,Cname,AVG(Grade)
from C join SC on C.Cno=SC.Cno
group by C.Cno,Cname
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询