SELECT st.s_id,st.s_name,AVG(sc.s_score) FROM student st
LEFT JOIN score sc ON sc.s_id=st.s_id
GROUP BY st.s_id HAVING AVG(sc.s_score)>=85
-- 33、查询平均成绩大于等于85的所有学生的学号、姓名和平均成绩
最新推荐文章于 2022-10-01 11:21:18 发布
SELECT st.s_id,st.s_name,AVG(sc.s_score) FROM student st
LEFT JOIN score sc ON sc.s_id=st.s_id
GROUP BY st.s_id HAVING AVG(sc.s_score)>=85