select s.学号,s.姓名 from Student s, Sc
where s.学乎拍号=Sc.学号
group by s.学号,s.姓名
having count(sc.课槐顷唤程编号)=5;
---
以铅凯上,希望对你有所帮助。
select s.学号,s.姓拍察名 from Student s, Sc
where s.学旅耐号=Sc.学号
group by s.学号,s.姓名
having count(sc.课程编号)=5;
这一个是正确的,其他的是错误的袭镇茄!
SELECT STUDENT.学号, STUDENT.姓派姿名
FROM STUDENT, COURSE, SC
WHERE STUDENT.学号 = SC.学号
AND COURSE.编号 = SC.课程编禅茄号
GROUP BY STUDENT.学号, STUDENT.姓名
HAVING COUNT(COURSE.编贺羡察号) = 5
SELECT s.学号,s.姓名 FROM student s JOIN sc
ON s.学号郑昌=sc.学号
GROUP BY s.学耐岩号,s.姓昌丛御名
HAVING COUNT(sc.学号)=5
已经通过测试!
select 学码态号,姓名
from student
where 学号=(SELECT 学号
FROM sc
WEHERE SUM(课程编号)>5
GROUP BY 课迟圆源程编腔旦号
)