2026.4.1

张开发
2026/5/22 4:01:51 15 分钟阅读
2026.4.1
select courseNo 课程编号,sum(result)总分, avg(result) 平均分,max(result) 最高分, min(result) 最低分,count(result) 参考人数 from score group by courseNo having avg(result)90 order by avg(result) desc;select * from score inner join student; select count(*) from score; select count(*) from student; select (select count(*) from score) * (select count(*) from student); select score.studentNo 学号,studentName 学生姓名,sum(result)该生总分, avg(result) 平均分,count(result)考试人数 from score inner join student on score.studentNo student.studentNo group by score.studentNo having count(result) 2 order by avg(result) desc;select s.courseNo 课程编号,c.courseName 课程名称,sum(result) 科目总分,avg(result) 平均分,count(result)考试人数 from score as s inner join course as c on s.courseNo c.courseNo group by s.courseNo having count(result) 3 order by avg(result) desc; #进行三表联合查询 score student course select sc.studentNo 学生编号,st.studentName 学生姓名, sc.courseNo 课程编号,co.courseName 课程名称, sc.result 成绩 from score as sc inner join student as st on sc.studentNo st.studentNo inner join course co on sc.courseNo co.courseNo where st.classNo 202202;

更多文章