网站建设个人总结,长春火车站核酸检测多久出结果,官方商城网站建设,交换友情链接的要求有练习题 x25 10-120 统计每个班级期末成绩的最高分#xff08;Max#xff09;#xff0c;显示班级名称、期末最高成绩10-121 显示没有班导师的班级名称、院系名称10-122 将电子信息1班(班级编号#xff1a;08)的班主任编号改为李丽清老师的编号#xff08;PTA题目表述错误Max显示班级名称、期末最高成绩10-121 显示没有班导师的班级名称、院系名称10-122 将电子信息1班(班级编号08)的班主任编号改为李丽清老师的编号PTA题目表述错误10-123 删除所有选修了数据库课程的选课记录10-124 删除选修人数小于6的选课记录建议二刷10-125 给订单量最多的员工加薪1000元通过一半10-126 检索没被学生选修的课程编号和课程名称10-127 统计学校已开设的课程门数10-128 检索出students表、sc表和course表中李小鹏同学所选课程名称10-129 检索出teacher、teaching、course表中“王珊”老师所授课程的课程名称distinct去重10-130 检索出teachers、teaching、sc表中“谭浩强”教师任课的课程号选修其课程的学生的学号和成绩建议二刷10-131 检索出students表和sc表中信息学院学生所选修的课程号和成绩10-132 检索出teachers表、teaching表和course表中女教师所授课程的课程号和课程名称distinct去重10-133 检索出students表、sc表中至少选修2门课程的女生姓名10-134 检索出students表、sc表中选修“0000011”课程的学生至2050年时平均年龄要求结果中列名显示“平均年龄”不会10-135 检索出students表和sc表中所有学生的选课情况包括学号姓名课号成绩结果中包括没有选课的学生10-136 检索出students表和sc表中没有选课的学生学号和姓名10-137 检索出students表和sc表中“19信管2”班的学生所选修的课程号10-138 检索出students表和sc表中“陈晓东”同学所选课程的课号及成绩10-139 检索出students表中出生日期大于所有女同学出生日期的男同学的姓名及系别10-140 检索出students表、sc表中信息学院女学生的学生学号、姓名、课号及考试成绩。10-141 检索出students表、sc表中“陈红”同学所选课程的成绩列出课号和成绩(不考虑重名)10-142 检索出teachers 、teaching、course表中“王珊”老师所授课程的课程名称distinct去重10-143 查询所授每门课程平均成绩均在70分以上的教师(MSSQL)10-144 检索Student表中与‘张三’在同一个专业的学生记录(MSSQL字符匹配) 10-120 统计每个班级期末成绩的最高分Max显示班级名称、期末最高成绩
-- 统计每个班级 期末成绩的最高分
select GName,max(SCScore3) Max
from student,sc,grade
where student.SIdsc.SId
and student.GIdgrade.GId
group by GName-- 依据输出样例分析 需要的表
-- 多表连接、等值连接10-121 显示没有班导师的班级名称、院系名称
select GName,DName
from grade
left join dept on grade.DIddept.DId
where TId null-- 筛选符合输出样例的表
-- 以grade表为主若TId为空则表示没有班导师10-122 将电子信息1班(班级编号08)的班主任编号改为李丽清老师的编号PTA题目表述错误
update grade
set TId(select TId from teacher where TName李丽青)
where GId 08
and GName 电子信息1班10-123 删除所有选修了数据库课程的选课记录
delete
from sc
where CId in (select CIdfrom coursewhere CName数据库
) -- 删除所有选修了数据库课程的 选课记录10-124 删除选修人数小于6的选课记录建议二刷
delete
from sc
where CId in (select CIdfrom(select CIdfrom scgroup by CIdhaving count(CId) 6) temp
)-- 不能在同一个表中 一边查找一边删除
-- 解决方法为使用派生表10-125 给订单量最多的员工加薪1000元通过一半
update employee
set Salary Salary1000
where Eid (select Eidfrom ordersgroup by Eidorder by sum(QTY) desclimit 1
)-- 做不会10-126 检索没被学生选修的课程编号和课程名称
select course.cno,cname
from course
left join score on course.cnoscore.cno
where sno null-- 避免 ambiguous 错误
-- 以course表为基准sno为空则无人选择10-127 统计学校已开设的课程门数
select count(*) 开设课程数
from course10-128 检索出students表、sc表和course表中李小鹏同学所选课程名称
select distinct cname
from students,sc,course
where students.snosc.sno
and course.cnosc.cno
and sname李小鹏10-129 检索出teacher、teaching、course表中“王珊”老师所授课程的课程名称distinct去重
select distinct cname
from teachers,teaching,course
where teachers.tnoteaching.tno
and teaching.cnocourse.cno
and tname王珊-- 万能去重10-130 检索出teachers、teaching、sc表中“谭浩强”教师任课的课程号选修其课程的学生的学号和成绩建议二刷
select sc.cno,sno,score
from teachers,teaching,sc
where teachers.tnoteaching.tno
and teaching.cnosc.cno
and tname谭浩强-- 建议二刷10-131 检索出students表和sc表中信息学院学生所选修的课程号和成绩
select cno,score
from students,sc
where students.snosc.sno
and sdept信息学院10-132 检索出teachers表、teaching表和course表中女教师所授课程的课程号和课程名称distinct去重
select distinct course.cno,cname
from teachers,teaching,course
where teachers.tnoteaching.tno
and teaching.cnocourse.cno
and tsex女-- distinct 去重10-133 检索出students表、sc表中至少选修2门课程的女生姓名
select sname
from students
where sno in(select snofrom scgroup by snohaving count(cno)2
)
and ssex 女-- 审题10-134 检索出students表、sc表中选修“0000011”课程的学生至2050年时平均年龄要求结果中列名显示“平均年龄”不会
select round(avg(年龄),1) 平均年龄
from (select sno,2050 - year(bday) 年龄from studentswhere sno in (select sno -- 1.选修这门课的学号from scwhere cno0000011)
) temp-- 不会10-135 检索出students表和sc表中所有学生的选课情况包括学号姓名课号成绩结果中包括没有选课的学生
select students.sno,sname,cno,score
from students
left join sc on students.snosc.sno-- 将students 作为主表10-136 检索出students表和sc表中没有选课的学生学号和姓名
-- select sno,sname
-- from students
-- where sno not in (
-- select sno -- 1.查询选了课的学生
-- from sc
-- )-- 没有选课的学生select students.sno,sname
from students
left join sc on students.snosc.sno
where cno null-- 将students表作为主表连接cno null为没有选课10-137 检索出students表和sc表中“19信管2”班的学生所选修的课程号
select cno
from students,sc
where students.snosc.sno
and class19信管210-138 检索出students表和sc表中“陈晓东”同学所选课程的课号及成绩
select cno,score
from students,sc
where students.snosc.sno
and sname陈晓东10-139 检索出students表中出生日期大于所有女同学出生日期的男同学的姓名及系别
-- 出生日期 大于所有女同学出生日期 的男同学 的姓名及系别
-- select distinct sname,sdept
-- from students
-- where bday all(
-- select bday
-- from students
-- where ssex女
-- )
-- and ssex男select sname,sdept
from students
where bday (select max(bday)from studentswhere ssex女
)
and ssex男-- 大于所有 或者 比最大的都大10-140 检索出students表、sc表中信息学院女学生的学生学号、姓名、课号及考试成绩。
select sc.sno,sname,cno,score
from students,sc
where students.snosc.sno
and sdept信息学院
and ssex女10-141 检索出students表、sc表中“陈红”同学所选课程的成绩列出课号和成绩(不考虑重名)
select cno,score
from students
join sc on students.snosc.sno
where sname 陈红10-142 检索出teachers 、teaching、course表中“王珊”老师所授课程的课程名称distinct去重
select distinct cname
from teachers
join teaching on teachers.tnoteaching.tno
join course on teaching.cnocourse.cno
where tname王珊-- distinct !!!10-143 查询所授每门课程平均成绩均在70分以上的教师(MSSQL)
select CNO cno
from sc
group by CNO
having avg(GRADE)70-- 1.先处理sc表
-- 平均成绩大于70的cno10-144 检索Student表中与‘张三’在同一个专业的学生记录(MSSQL字符匹配)
select distinct sno 学号,sname 姓名
from stu
where mno in(select mno-- 1.查询张三的专业from stuwhere sname N张三
)
-- and not sname N张三
-- and sname N张三
and sname ! N张三
-- MSSQL字符串赋值,需要在字符串前面加 N