1.update 选课 set 成绩=成绩+5 where 课程号 in (select 课程号 from 课程 where 课程名="数据库"
2.update 选课 set 成绩=0 where 课程号="2"
3.update 选课 set 成绩=85 where 学号 in (select 学号 from 学生 where 姓名="李勇"
4.delete from 选课 where 课程号="2" and 成绩 is null
5.delete from 课程 where 课程号 not in (select 课程号 from 选课)
6.delete from 选课 where 课程号 in (select 课程号 from 课程名="数据库") and 学号 in (select 学号 from 学生 where 系名="计算机")
7.select 系名,sum(*) as 人数 from 学生 group by 系名,性别 into table 学生分类
8.select 学号,count(*) as 课程数,avg(成绩) as 平均成绩 from 选课 where avg(成绩)>=80 into table 成绩表
9.create view 无选修 as select 学号,姓名,系名 from 学生 where 学号 not in (select 学号 from 选课)
select * from 无选修
10. create view 成绩 as select 姓名,课程名,成绩 from 学生,课程,选课 where 学生.学号=选课.学号 and 选课.课程号=课程.课程号
select * from 成绩
11.create view 平均 as select 课程号,count(*) as 选课人数,avg(成绩) as 平均分,max(成绩) as 最高分 from 选课 group by 课程号
select 选课人数,平均分,最高分 from 平均 where 课程号="1"
12.create view 平均1 as select 学号,成绩 from 选课 where 课程号="2" and 成绩>(select avg(成绩) from 选课 where 课程号="2")