检索出选修课程至少等于三门的学生学号和选课门数

2025-01-02 05:00:55
推荐回答(2个)
回答1:

学生表s(学号s#,姓名sname,性别sex,年龄age)
课程表c(课程号c#,课程名cname)
成绩表sc(学号s#,课程号c#,分数grade)
select s.s#,count(c#)as 选课门数 from s,sc
where s.s#=sc.s#
group by s.s#
having count(c#)>=3,我们这几天也正学呢!

回答2:

select sno,count(*)as 选课门数
from score
group by sno
having count(*)>=3