建表语句点击详见
– 查询不同老师所教不同课程平均分从高到低显示
SELECT
t
.t_id
,
t
.t_name
,
c
.c_name
,
AVG(sc
.s_score
)
FROM teacher t
LEFT JOIN course c
ON c
.t_id
=t
.t_id
LEFT JOIN score sc
ON sc
.c_id
=c
.c_id
GROUP BY t
.t_id
ORDER BY AVG(sc
.s_score
) DESC
转载请注明原文地址:https://blackberry.8miu.com/read-29193.html