1 create view IS_Student.note
create view IS_Student
as
select Sno,Sname,Sage,Sdept
from student
where Sdept='IS'
select * from IS_student
2 .note
create view IS_S1(Sno,Sname, Grade)
as
select student.Sno, Sname, Grade
from student, sc
where Sdept='IS' and Student.sno=sc.sno and sc.cno='1'
select * from IS_s1
3 涉及 两个表 ---叙述清楚.note
create view IS_S1(Sno,Sname, Grade)
as
select student.Sno, Sname, Grade
from student, sc
where Sdept='IS' and Student.sno=sc.sno and sc.cno='1'
select * from IS_s1
4 视图的视图.note
create view IS_S2
as
select Sno, Sname, Grade
from IS_s1
where Grade>=90
select * from IS_s1
5 带 表达式的 视图.note
create view BT_s(Sno, Sname, Sbirth)
as
select Sno, Sname, 2016-Sage
from student
select * from BT_s
6 分组视图.note
create view S_G(Sno, Grade)
as
select Sno, AVG(Grade)
from SC
group by sno
select * from S_G
7.note
create view F_student(F_Sno, F_name,F_sex,F_age, F_dept)
as
select *
from student
where Ssex='女'
select * from F_student
8 删除视图.note
drop view IS_s1