数据库与实验2相同 就不重复展示了
select COUNT(*) as 人数 from SC where CNo='C1'
select CN as 课程名,COUNT(*) as 选课人数 from SC,c where sc.CNo=c.CNo and CN='程序设计' group by CN
select CN as 课程名,COUNT(*) as 选课人数, AVG(score) as 平均分,MAX(score) as 最高分, MIN(score) as 最低分, SUM(score) as 总分 from SC,c where sc.CNo=c.CNo group by CN
select s.dept as 系名,COUNT(*) as 人数 from s,t where s.Dept=t.Dept group by s.dept
select s.dept as 系名,s.Sex as 性别,COUNT(*) as 人数 from s,t where s.Dept=t.Dept and s.Sex='女' group by s.dept,s.sex
如需转载使用,请务必标明出处,谢谢