胜大大666: 这个17题也不完整,还是缺王菊 答案仅供参考: #17、按平均成绩从高到低显示所有学生的所有课程的成绩以及平均成绩 SELECT a.s_id,a.s_name,a.c_id, (select s_score from score where s_id=a.s_id and c_id='01') as 语文, (select s_score from score where s_id=a.s_id and c_id='02') as 数学, (select s_score from score where s_id=a.s_id and c_id='03') as 英语, FROM (SELECT s.s_id,s.s_name,sc.c_id,c.c_name,sc.s_score,avg(sc.s_score)AS avgscore FROM student s LEFT JOIN score sc USING(s_id) LEFT JOIN course c USING(c_id) GROUP BY s.s_id) AS a GROUP BY a.c_id,a.s_id ORDER BY DESC
乐优商城坑太多,新手别学。。网上教程资料不齐全
增删改查练习题和sql语句,50条常用sql语句练习