数据库 习题及答案 联系客服

发布时间 : 星期五 文章数据库 习题及答案更新完毕开始阅读

from st801,st802

where st801.学号=st802.学号

题 71 查询即选修了C801也C802课程的学号,姓名和班级名 select 学号,姓名,班级名 from 学生表

where exists(select * from 成绩表 where 学号=学生表.学号 and 课程号 ='C801') and exists(select * from 成绩表 where 学号=学生表.学号 and 课程号 ='C802') 题 72 查询教软件1班也教软件2班的教师,要求输出教师名 select distinct 教师名 from 授课表 A where exists(select * from 授课表 where 教师名=A.教师名 AND 班级名='软件1班') and exists(select * from 授课表 where 教师名=A.教师名 AND 班级名='软件2班') 题 73 查询软件2班所学习过的课程 select 课程号,课程名 from 课程表

where 课程号 in(select 课程号 from 成绩表 where 学号 in(select 学号 from 学生表 where 班级名='软件2班')) 题 74 查有学生选修的课程号和课程名 select 课程号,课程名 from 课程表

where 课程号 in(select 课程号 from 成绩表)

题 75 查询姓名相同的学生名要求输出姓名和重名人数 select 姓名,count(*) '重名人数' from 学生表 group by 姓名 having count(*)>1