SQL面试50题-32
32、查询平均成绩大于等于85的所有学生的学号、姓名和平均成绩(不重要)
SELECT st.s_id,st.s_name,AVG(sc.s_score) FROM Student st INNER JOIN Score sc ON sc.s_id = st.s_id GROUP BY st.s_id,st.s_name HAVING AVG(sc.s_score) >= 85
32、查询平均成绩大于等于85的所有学生的学号、姓名和平均成绩(不重要)
SELECT st.s_id,st.s_name,AVG(sc.s_score) FROM Student st INNER JOIN Score sc ON sc.s_id = st.s_id GROUP BY st.s_id,st.s_name HAVING AVG(sc.s_score) >= 85
相关推荐