【Mysql】针对actor表创建视图actor_name_view,只。。。
针对actor表创建视图actor_name_view
http://www.nowcoder.com/questionTerminal/b9db784b5e3d488cbd30bd78fdb2a862
题目描述:针对actor表创建视图actor_name_view,只包含first_name以及last_name两列,并对这两列重新命名,first_name为first_name_v,last_name修改为last_name_v
两种写法:
1.直接在视图名的后面用小括号创建视图中的字段名
create view actor_name_view (first_name_v,last_name_v) as select first_name ,last_name from actor
2.在select后面对列重命名为视图的字段名
create view actor_name_view as select first_name as first_name_v ,last_name as last_name_v from actor
牛客题霸-SQL篇【Mysql】 文章被收录于专栏
少壮不努力,老大勤刷题