#1
create view view_XS as select * from students where address = "北京";
#2
create view view_CJ(sno,cno,grade)
as select s.sno,c.cno,sc.grade from courses c,score sc,students s
where (s.sno = sc.sno and c.cno = sc.cno) and c.ctype = '选修';
#3
create view view_sex(sex,sexnum)
as select sex,count(sex) from students;
GROUP BY sex;
#4
create view view_avg(sno,sname,grade_avg)
as select students.sno,sname,avg(grade) from students
join score on students.sno = score.sno
GROUP BY score.sno;
#5
select * from view_cj where grade >= 90;
#6
select avg(grade) from view_avg where sname = '张三';
#7 xx
insert into view_xs(sno,sname,sex,sbirthday,saddress) VALUES('2018001','赵红平','男', '1983-04-29','北京');
#8
UPDATE view_xs set sname = '李娟' where sno='2018001';
#9
DELETE from view_xs where sno='2018001';
#10
DROP view view_xs;