3. 查询选修1号 课程的学生学号和成绩,并要求对查询结果按成绩的降序排列,如果成绩相同则按学号的升序排列;
SELECT student.Sno,Grade
FROM student,sc
WHERE Cno='1'and student.Sno=sc.Sno
ORDER BY Grade DESC
13. 查询所在系部为“MA”且选修了数学课程的学生姓名,年龄,性别;
SELECT Sname,Sage,Ssex
FROM student,course
WHERE Sdept='MA'and Cname='数学'
23. 查询每个系部的学生人数;
33. 查询每个学生的学号,姓名,所获得的总学分(成绩大于等于60,则获得该门课程的学分);
SELECT sc.Sno,Sname,COUNT(Ccredit)
FROM student,course,sc
WHERE Grade>60 and student.Sno=sc.Sno and sc.Cno=course.Cno
GROUP BY sc.Sno,Sname