create or replace view stu_v(视图名) as select id,name from student where id<=10;
as 后面指定视图封装的数据
1.show create view stu_v(视图名);
2.select * from stu_v(视图名);
1.create or replace view stu_v(视图名) as select id,name,number from student where id<=10;
2.alter view stu_v(视图名) as select id,name from student where id<=10;
insert into stu_v values(6,"tom");
drop view if exists stu_v;
加入 with cascaded check option;
with local check option;
默认为cascadeed 直接写with check option;
会对插入数据是否符合规则进行检查。
会检查加入了cascaded视图的向上的依赖视图。
不管依赖的视图有没有检查校验,都会按照条件校验
也会递归调用依赖的视图,但依赖的视图必须有检查校验