create view pb_quarters as
select * from piggy_bank
where coin = 'Q'
select * from pb_quarters
create view pb_dimes as
select * from piggy_bank
where coin = 'D'
select * from pb_dimes
create view pb_neckel as
select * from piggy_bank
where coin = 'N' with check option
select * from pb_neckel
insert into pb_quarters values('Q', '1993')
select * from pb_quarters
insert into pb_quarters values('D', '1942')
select * from pb_quarters
1.当插入视图的值在视图中不存在,则插入无效,如果‘D’不存在,则插入无效,而Q存在,则insert 有效。
本文转自鹅倌51CTO博客,原文链接: http://blog.51cto.com/kaixinbuliao/881679,如需转载请自行联系原作者