SQL面试50题-21
链接:https://zhuanlan.zhihu.com/p/43289968
查询不同老师所教不同课程平均分从高到低显示(不重点)
SELECT t.t_id,t.t_name,c.c_id,AVG(s.s_score) avg_score FROM Score s INNER JOIN Course c ON c.c_id = s.c_id INNER JOIN Teacher t ON t.t_id = c.t_id GROUP BY t.t_id,c.c_id ORDER BY avg_score DESC