access SQL语句问题

第11题 用SQL查询语句解答 感谢

img


a b c d e f g h I j k l m n o p q r s t u v w x y z

自己根据实际表和字段改下:

-- 8
select 学号, avg(成绩) from 成绩表 where 学号 in (select 学号 from 选课表 group by 学号 having count(*)>=3)
-- 9
select * from 学生表 where 学号 in (select 学号 from 选课表 where 课程编号='1003')
-- 10
select a.学号 from (select 学号 from 选课表 where 课程编号='1001') a, (select 学号 from 选课表 where 课程编号='1002') b where a.学号=b.学号
-- 11
select a.学号, a.学生姓名, b.总学分  /*如果有学生缺考,未录入成功,统计不到学分,就把 b.总学分 改为 case when b.总学分 is null then 0 else 总学分 end 总学分*/
from 学生表 a left join
(select 学号, sum(case when 成绩>=60 then 1 else 0 end) 总学分 from 成绩表 group by 学号) b
on a.学号=b.学号
-- 12
insert into 高级职称 select * from 教师信息 where 职称='教授'
-- 如果 高级职称 和 教师信息 表字段数不一样,改下后面的查询,类似这样:select a, b, 'xx' from ...