数据库 一个数据库中有四张表,分别如下:

数据库 一个数据库中有四张表,分别如下:,第1张

select

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.sid

join 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'


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/6806167.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-28
下一篇 2023-03-28

发表评论

登录后才能评论

评论列表(0条)

保存