11、创建视图

 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;


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

乄辰_qq_2791629529

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值