46.#查询全部学生都选修的课程的课程号和课程名;
select sc.c,max(course.cname),count(sc.s) from sc join course on(sc.c=course.c)
group by sc.c
having count(sc.score) >(select count(distinct s) from sc)
43.查询每门课程成绩最好的前两名;
SELECT * FROM sc AS a join student on(a.s=student.s)
WHERE 2 > ( SELECT COUNT(*) FROM sc WHERE c = a .c AND score>a .score )
ORDER BY a.score DESC;
40)查询选修“杨艳”老师所授课程的学生中,成绩最高的学生姓名及其成绩;
SELECT student.sname,sc.s,sc.score from sc,student,teacher,course
where sc.score =( select max(a.score) from sc a where a.c=sc.c) and teacher.tname='杨艳' and sc.s = student.s and sc.c=course.c and course.t=teacher.t
1/期间玩手机过程,观看其他网站时间过长,需要控制
2/题目多想想,不要一老看答案,理解完了才算掌握。