create view L_view1 as
select 读者编号,姓名,类名,可借天数,可借数量
from 读者表,读者类型表
where 读者表.类别号=读者类型表.类别号;
/*2*/
select 读者编号,姓名,类名,可借天数,可借数量
from L_view1
where 类名='学生';
/*3*/
create view L_view2 as
select 借阅号,书号,姓名,借阅日期,还书日期
from 读者表,借阅表,库存表
where 读者表.读者编号=借阅表.读者编号 and 库存表.条码=借阅表.条码;
/*4*/
select 借阅号,书号,姓名,借阅日期,还书日期
from L_view2
where 还书日期 is null;
/*5*/
create view L_view3 as
select * from 借阅表
where 借阅状态='借阅' or 借阅状态='已还'
WITH CHECK OPTION;
/*1*/
insert into L_view3 values(100010,'411112','2001','2020-10-18',Null,'借阅');
/*2*/
update L_view2 set 借阅日期=curdate() where 借阅号=100001;
/*3*/
delete from L_view3 where 还书日期 is not Null;
/*1*/
drop view L_view2,L_view3;
标签:11,view2,创建,视图,日期,读者,借阅,where,select
From: https://blog.csdn.net/dADDSDWd/article/details/144592783