题解 | #查找所有员工的last_name和first_name以及对应的dept_name#

针对actor表创建视图actor_name_view

http://www.nowcoder.com/practice/b9db784b5e3d488cbd30bd78fdb2a862

创建视图的语法为:

CREATE [OR REPLACE] [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]
VIEW view_name [(column_list)]
AS select_statement
[WITH [CASCADED | LOCAL] CHECK OPTION]

修改视图的语法为:

ALTER [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]

VIEW view_name [(column_list)]

AS select_statement

[WITH [CASCADED | LOCAL] CHECK OPTION]
选项 : 
    WITH [CASCADED | LOCAL] CHECK OPTION 决定了是否允许更新数据使记录不再满足视图的条件。

    LOCAL : 只要满足本视图的条件就可以更新。
    CASCADED : 必须满足所有针对该视图的所有视图的条件才可以更新。 默认值.
create or replace view actor_name_view
as select first_name as first_name_v,last_name as last_name_v from actor;
全部评论

相关推荐

爱看电影的杨桃allin春招:我感觉你在炫耀
点赞 评论 收藏
分享
头像
11-09 17:30
门头沟学院 Java
TYUT太摆金星:我也是,好几个华为的社招找我了
点赞 评论 收藏
分享
点赞 1 评论
分享
牛客网
牛客企业服务