SQL38 针对actor表创建视图actor_name_view
针对actor表创建视图actor_name_view,只包含first_name以及last_name两列,并对这两列重新命名,first_name为first_name_v,last_name修改为last_name_v:
CREATE TABLE actor (
actor_id smallint(5) NOT NULL PRIMARY KEY,
first_name varchar(45) NOT NULL,
last_name varchar(45) NOT NULL,
last_update datetime NOT NULL);
后台会插入2条数据:
insert into actor values (‘1’, ‘PENELOPE’, ‘GUINESS’, ‘2006-02-15 12:34:33’), (‘2’, ‘NICK’, ‘WAHLBERG’, ‘2006-02-15 12:34:33’);然后打印视图名字和插入的数据
————————————————————————————————————————————————————
CREATE VIEW actor_name_view AS
select first_name as first_name_v,last_name as last_name_v
FROM actor