题解 | #查找所有员工的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;