麻烦老师指点一下
//2 select class.name,score.course,AVG(score.mark) from class join stu on class.c_id=stu.class join score on stu.s_id=score.s_id group by class.name,course; //3 select stu.s_id as id,name as 姓名,sex as 性别,sum(mark) as 总分 from stu join score on stu.s_id=score.s_id group by id order by 总分 desc; //4 select stu.s_id as id,stu.name as 姓名,class.name as 班级,score.mark as 分数 from stu join score on stu.s_id=score.s_id join class on class.c_id=stu.class where mark BETWEEN 75 and 85; //5 update score set mark=88 where(select s_id from stu where name='李咪咪') and course='数学'; //6 select class.c_id as id, class.name as 班级,score.course as 课程,avg(mark) as 平均分 from class join stu on class.c_id=stu.class join score on stu.s_id=score.s_id where descrip='重点班' group by id,课程 order by 平均分 desc;
2
收起
正在回答
1回答
同学的代码整体写的不错,
1、同学没有提供同学创建表的过程和数据填充的过程,也就是少了第一步哦。
2、关于第四步,作业要求查询课程成绩小于75分的学生ID,姓名,班级,课程以及分数
同学查询的是75到80直接的,并且没有展示对应的课程。老师做了如下修改
SELECT stu.s_id AS id,stu.name AS 姓名,class.name AS 班级,score.mark AS 分数, score.course FROM stu JOIN score ON stu.s_id=score.s_id JOIN class ON class.c_id=stu.class WHERE mark < 75 ;
3、由于题目中的同学是李米米,这里老师做了修改,如果同学写的叫“李咪咪”,按照同学写的即可
如果我的回答解决了你的疑惑,请采纳!祝学习愉快!
3. Java 数据库开发与实战应用
- 参与学习 人
- 提交作业 357 份
- 解答问题 8016 个
本阶段将带你学习MySQL数据库,JDBC接口,MyBatis框架等,带你掌握的数据的存放和管理。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星