1. 程式人生 > >38. 針對actor表建立檢視actor_name_view

38. 針對actor表建立檢視actor_name_view

題目描述

針對actor表建立檢視actor_name_view,只包含first_name以及last_name兩列,並對這兩列重新命名,first_name為first_name_v,last_name修改為last_name_v:
CREATE TABLE IF NOT EXISTS actor (
actor_id smallint(5) NOT NULL PRIMARY KEY,
first_name varchar(45) NOT NULL,
last_name varchar(45) NOT NULL,
last_update timestamp NOT NULL DEFAULT (datetime('now','localtime')))

CREATE VIEW actor_name_view AS SELECT
	first_name AS first_name_v,
	last_name AS last_name_v
FROM
	actor;