create [or replace] [algorithm = {UNDEFINED | MERGE | TEMPTABLE}]
view viewName [(columnList)]
as selectStatement
[with [CASCADED | LOCAL] check option]
--replace 表示替换已经创建的视图
--[algorithm = {UNDEFINED | MERGE | TEMPTABLE}] 表示视图选择的算法
--viewName 为视图的名称
--columnList 为属性列
--selectStatement 表示SELECT语句
--[with [CASCADED | LOCAL] check option]表示视图在更新时保证在视图的权限范围之内
-- 源表or视图表更新,对应的视图表or源表随之更新
创建视图
删除视图
drop view [if exists] viewName [,viewName ]