题解 | 平均成绩大于60分的学生人数

SELECT
    count(*)
FROM
    (
        SELECT
            SC.sid as sid,
            avg(SC.score) as avcorse
        FROM
            SC
            INNER JOIN Course as CT ON SC.cid = CT.cid
            INNER JOIN Student as ST ON SC.sid = ST.sid
        GROUP BY
            sid
        having
            avcorse > 60
    ) as re

全部评论

相关推荐

评论
点赞
收藏
分享
牛客网
牛客企业服务