Ss#
as
学号,avg(score)
as
平均成绩
from
SC
group
by
Ss#
having
avg(score)>60
select
T1.S#,
T1.Sname,
T2.选课数,
T2.总成绩
FROM
student
T1,
(
SELECT
S#,
COUNT(C#)
as
CNT,
SUM(SCORE)
as
总成绩
FROM
SC
GROUP
BY
S#
)
T2
WHERE
T1.S#
=
T2.S#
1) select s.Name from Student s join StuCur c on s.id=c.sidjoin Course cu on cu.id=c.cid where cu.Name='自然'
2) select c.Name from Course c join StuCur sc on c.id=sc.CID
join Student s on sc.sid=s.id where s.EntranceTime between '1999-01-01' and '2012-12-31'
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)