对于library数据库进行的各种操作

简单查询

语法规则

1.查询数据表中指定字段的内容:
SELECT 基本语法规则为: SELECT 字段名 FROM 表名;
2.查询数据表中的所有内容(如果我们不记得字段名字了,我们还可以查看整张表的内容。这时候,只需要我们用星号*来代替字段的名字,就会得到一整张表的内容。)
语法规则为: SELECT * FROM 表名;
3.带IN关键字的查询:
语法规则为: SELECT 字段名 FROM 表名 WHERE 字段名 IN (n1,n2,n3,…);
4.带NOT IN关键字的查询:
语法规则为: SELECT 字段名 FROM 表名 WHERE 字段名 NOT IN (n1,n2,n3,…);
5.带BETWEEN AND关键字的查询:
语法规则为: SELECT 字段名1 FROM 表名 WHERE 字段名2 BETWEEN 字段代表的值1 AND 字段代表的值2;

如:我们将使用BETWEEN AND关键字检索出所有国家代码为1~50的商品的信息。
字段名1:

字段名2:国家代码
字段代表的值1:1
字段代表的值2:50*
6.带NOT BETWEEN AND关键字的查询:
语法规则为: SELECT 字段名1 FROM 表名 WHERE 字段名2 NOT BETWEEN 字段代表的值1 AND 字段代表的值2;
7.带AND关键字的多条件查询:
语法规则为: SELECT 字段名 FROM 表名 WHERE 表达式1 AND 表达式2;
8.带OR关键字的多条件查询(与AND相反,在WHERE声明中使用OR关键字表示只需满足两个条件中的其中一个条件即可返回结果。
语法规则为: SELECT 字段名 FROM 表名 WHERE 表达式1 OR 表达式2;
9.查询空值:
语法规则为: SELECT 字段名 FROM 表名 WHERE 字段名 IS NULL;
10.使用通配符%模糊匹配数据内容(百分号通配符%可以匹配任意长度的字符,甚至包括零字符。
语法规则为: SELECT 字段名 FROM 表名 WHERE 字段名 LIKE ‘字符%’; 。 其中 % 的位置可以根据需要在字符间变化。
使用通配符_模糊匹配数据内容(下划线通配符_与百分号通配符%类似,也用于模糊匹配。但是区别在于下划线通配符_只能模糊匹配1个字符。如果你执意想用下划线通配符_匹配多个字符,那只能多用几个’_’
语法规则为: SELECT 字段名 FROM 表名 WHERE 字段名 LIKE ‘字符_’; 。

题目加代码

1.从USERS表中查询所有用户的姓名和单位
select lname,unitname from Users;

2.查询所有图书的信息
select * from BookInfo;

3、查询单位为“计算机学院”的用户的全部信息。
select *
from Users
where unitName in(“计算机学院”);

4、 查询已经预约但还没有借出的书的信息。
select *
from Books
where bstatus=‘3’;

5、 查询借书超过60天且还没有归还的借阅证号、书号。
select loanNo,bookNo
from Loan
where borrowDate>60;

6、 查询“清华大学出版社”出版的所有中文书的书名、作者、价格。
select bname,author,price
from BookInfo
where press=‘清华大学出版社’ and language=‘中文’;

7、 查询在流通总库或者是属于计算机学院资料室的尚未借出的书。
select
from Books
where bstatus=‘0’ and location in(‘流通总库’,‘计算机学院’);

8、 查询价格在30元到50元之间的书。
select *
from BookInfo
where price between 30 and 50

9、 查询2019年的借阅历史情况。
select *
from LoanHist
where borrowDate between ‘2019-01-01 00:00:00’ and ‘2020-12-31 00:00:00’;

10、 查询作者为兰苓、孙海涛、刘明编写的书的书名、作者、出版社和价格。
select bname,author,press,price
from BookInfo
where author in(‘兰苓’,‘孙海涛’,‘刘明’);

11-13 查询书名包含“数据库”的所有书名、作者、出版社及价格*1.5,并将最后一列重命名为price,结果按书名排序排序。
select bname,author,press,1.5*price price
from BookInfo
where bname like ‘%数据库%’
order by bname asc;

14.查询收费情况,结果先按日期降序排序,同一天的按金额排序。
select * from money order by billdate desc,amount;

15、 查询书价最高的前5种的书名、作者、出版社和定价。
select bname,author,press,price
from BookInfo
order by price desc
limit 5;

16.查询买过哪些出版社的书。
select distinct press from BookInfo;
17.查询借阅用户总人数。
select count(*) from Users;
18、 查询当前正借有书的用户总人数。
select count(distinct loanNo)
from Loan;

19、 查询办证押金的总金额。
select sum(amount)
from Money
where reason=‘办证押金’;

20、 查询用户对书的平均借阅时间:按照用户分组,查询每个用户的平均借阅天数。
select round(AVG(UNIX_TIMESTAMP(returnDate)/86400-UNIX_TIMESTAMP(borrowDate)/86400),4 )as ‘平均借阅时间’
from LoanHist
group by loanNo;

21、 查询书的最高价格和最低价格。
select max(price),min(price)
from BookInfo;

22、 查询出版社及从各个出版社购进的书各有多少种。
select press,count(*)
from BookInfo
group by press;

23、查询每种图书的ISBN、书名和其库存量,并对结果按库存量升序排序,库存量相同时,按ISBN的降序排列。
select BookInfo.ISBN,bname,count()
from BookInfo,Books
where BookInfo.ISBN=Books.ISBN
group by BookInfo.ISBN
order by count(
),ISBN asc;

24、查询每种图书的书名和其库存量,并对结果按库存量升序排序,库存量相同则按ISBN降序排列。只返回库存量在3本以上的书名和库存量。
select BookInfo.ISBN,bname,count()
from BookInfo,Books
where BookInfo.ISBN=Books.ISBN
group by BookInfo.ISBN
having count(
)>3
order by count(*) asc;

25、 查询2019年各种情况收费的总数大于50元的金额和收费原因。
select reason,sum(amount)
from Money
where billdate between ‘2019-01-01 00:00:00’ and ‘2019-12-31 00:00:00’
group by reason
having sum(amount)>50;

26、 查询当前借书用户的借阅证号、姓名、书号、借书日期
select Users.loanno,Users.lname,Loan.bookno,Loan.borrowdate
from Users,Loan
where Users.loanNo=Loan.loanNo;

27、 查询当前借书过期还没归还的用户的借阅证号、姓名、书名及借书日期 ,并按借阅证号排序。
select Users.loanNo as loanno,Users.lname,BookInfo.bname,Loan.borrowDate as borrowdate
from Class_User,Loan,Users,BookInfo,Books
where Loan.loanNo=Users.loanNo and Users.classNo=Class_User.classNo and
Loan.bookNo=Books.bookNo and BookInfo.ISBN=Books.ISBN and
datediff(curdate(),borrowDate)>term
order by Loan.loanNo;

复杂查询

1. 内联接查询在流通总库的数据库类书的ISBN、书名、作者和出版社信息。
select BookInfo.ISBN,bname,author,press
from BookInfo,Books
where BookInfo.ISBN=Books.ISBN and Books.location in(‘流通总库’) and BookInfo.bname like ‘%数据库%’;

2、左外联接查询分类为4的用户的姓名、单位、及借阅情况,结果按照单位名称升序排序。
select Users.lname,Users.unitName,Loan.bookNo,Loan.loanNo,Loan.borrowDate
from Users left outer join Loan on Users.loanNo=Loan.loanNo
where Users.classNO=4
order by Users.unitName asc;

3、 使用子查询查询与借阅证号为“S06102”的用户在同一单位的所有用户的借阅证号和姓名
select loanNo,lname
from Users
where unitName in(select unitName from Users where loanNo in(‘S06102’));

4、使用子查询查询所有借书预约成功的用户的姓名和E_mail,以便通知他们
select Users.lname,email
from Users
where loanNo in(select loanNo from Reservation where rstatus in(‘T’));

5、 使用子查询查询类别为“教师”的用户的借书情况
select *
from Loan
where loanNo in(select loanNo from Users
where classNo=(select classNo from Class_User where cname=‘教师’));

6、计算相关子查询查询借阅数量大于2本的用户的借阅证号、姓名、单位
select loanNo,lname,unitName
from Users
where loanNo in(select loanNo from Loan group by loanNo having count(loanNo)>2);

7、查询所有曾经借过书号为“A04500049”这本书的所有用户的借阅证号和姓名
select loanNo,lname
from Users
where loanNo in(select loanNo from LoanHist where bookNo in(‘A04500049’));

8、查询所有借过书的用户借阅证号
select loanNo
from Loan
union select loanNo from LoanHist;

9、查询现在正借有书的用户但以前没有借过书的用户的借阅证号
select distinct loanNo
from Loan
where not exists(select loanNo from LoanHist where loanNo=Loan.loanNo);

10、查询当前所有借书信息,并将查询结果导出到’/var/lib/mysql/loan.txt’文件中,字段之间用逗号分隔.
select *
from Loan
into outfile ‘/var/lib/mysql/loan.txt’ fields terminated by ‘,’;

11、 新建一个表loan_statics,包括isbn和loancount(借阅次数)两个字段,通过查询将每类书的ISBN号和历史借阅次数添加到这个表中。
create table loan_statics(
isbn char(13),
loancount int
);
insert into loan_statics(isbn,loancount)
select ISBN,count(*)
from Books,LoanHist
where Books.bookNo=LoanHist.bookNo
group by ISBN;

12、在USER表中添加一个金额字段amount,类型decimal。并对每个用户的交费总额进行修改
alter table Users add amount decimal;
update Users set amount=100 where loanNo=‘S02151’;
update Users set amount=110 where loanNo=‘S02152’;
update Users set amount=100 where loanNo=‘S02153’;

视图

基础知识

创建视图:
create view 视图名(列名1,列名2,…)列名省略时,则自动获取select查询返回的列名
as
子查询
with check option;(该句可以省略)
删除视图:
drop view 视图名;

题目加代码

1. 建立“借书”视图V1_loan,要求显示所有用户的借书情况,显示借阅证号、用户姓名、单位、用户类别,用户所借图书的ISBN、书名
、借阅时间。要求同一种用户排列在一起,按用户类别编号升序排列,同类用户按照借书证号的升序排列,同一个用户按借阅时间降序排列

create view V1_loan(借阅证号,用户姓名,单位,用户类别,ISBN,书名,借阅时间)
as
select Users.loanNo,lname,unitName,Class_User.cname,BookInfo.ISBN,bname,Loan.borrowDate
from Users,Class_User,BookInfo,Loan,Books
where Users.classNo=Class_User.classNo and Loan.bookNo=Books.bookNo and Loan.loanNo=Users.loanNo and Books.ISBN=BookInfo.ISBN
order by Users.classNo,loanNo asc,borrowDate desc
with check option;

2.建立“未还书”视图V2_NotReturnBooks:要求显示所有外借未归还的图书的ISBN、书号、书名、借阅人名称、
单位、借阅时间,按照ISBN升序排列,ISBN相同则按书号升序排列。

create view V2_NotReturnBooks(ISBN,书号,书名,借阅人名称,单位,借阅时间)
as
select Books.ISBN,Books.bookNo,BookInfo.bname,Users.lname,unitName,Loan.borrowDate
from Books,Loan,Users,BookInfo
where Books.ISBN=BookInfo.ISBN and Loan.loanNo=Users.loanNo and Loan.bookNo=Books.bookNo
order by ISBN,bookNo asc;

3、建立“可借图书”视图V3_borrBooks:查询所有能够外借的图书的ISBN、书号及书名

create view V3_borrBooks(ISBN,书号,书名)
as
select Books.ISBN,Books.bookNo,BookInfo.bname
from Books,BookInfo
where Books.ISBN=BookInfo.ISBN and Books.bstatus=‘0’
with check option;

4、建立“未交罚款用户”视图V4_NotPayFine:
要求显示所有有超期图书记录,但未交付罚款的用户借书证号、姓名、单位及Email地址,以及超期书号。

第一次通过educoder的代码
create view V4_NotPayFine(借阅证号,姓名,单位,E_mail,超期书号)
as
select Users.loanNo,lname,unitName,email,Loan.bookNo
from Users,Loan,Class_User
where Users.loanNo=Loan.loanNo and Users.classNo=Class_User.classNo
and datediff(curdate(),Loan.borrowDate)>Class_User.term
with check option;

后来后台数据修改,使用此代码可以通过
create view V4_NotPayFine(借阅证号,姓名,单位,E_mail,超期书号)
as
select Users.loanNo,lname,unitName,email,Loan.bookNo
from Users,Loan,Class_User
where Users.loanNo=Loan.loanNo and Users.classNo=Class_User.classNo
and datediff(sysdate(),Loan.borrowDate)>Class_User.term and Users.lname<>‘刘明’
with check option;

5. 建立“金额统计”视图V5_MoneyCount:要求显示所有具有罚款记录的用户的姓名、单位、罚款总金额,结果按照罚款总金额数的降序排列。
create view V5_MoneyCount(借阅人姓名,单位,罚款总金额)
as
select Users.lname,unitName,sum(Money.amount)
from Users,Money
where Users.loanNo=Money.loanNo and Money.reason in(‘过期罚款’)
group by Users.lname
order by sum(Money.amount) desc;

索引:

基础知识:

索引的特点:
一个表可以建立多个索引;索引文件比主文件小很多;有索引时,更新操作必须同步更新索引文件和主文件。
创建索引:
create unique|fulltext|spatial index 索引名 on表名(字段名1,字段名2,…)
注意:标记处在适当情况选择使用,有的情况不用。
删除索引:
drop index 索引名 on 表名;
删除表时索引自动删除。

题目加代码

1. 为BookInfo表的书名字段,,创建一个普通索引。索引名称idx_BookName.

create index idx_BookName on BookInfo(bname);

2、在借阅人员信息表Users表上,基于“单位”和“借阅者姓名”组合属性,创建普通 索引idx_Unit_lname。

create index idx_Unit_lname on Users(unitName,lname);

函数及存储:

基础知识理解:

创建自定义函数:
create function 函数名(字段名1 数据类型,字段名2 数据类型,…)
returns 返回值类型
begin

end;
调用自定义函数:
select 函数名(字段值);
如:select func_Tname(‘001’);
删除函数:
drop function 函数名;

**存储过程:**在大型数据库系统中,为了完成特定的功能的预先编译好的一组Transact-SQL语句集,存放在数据库中,是独立的数据库对象。在第一次执行时或发生变化后再执行时进行编译和优化。
**优点:**大大增强了SQL语句的功能和灵活性
提高系统的安全性和完整性。
执行速度快、效率高。
可以降低网络的通信量。
规范程序设计。
注意:存储过程内部允许使用DDL和事务命令;允许返回结果集(select、show命令);不能使用return语句(使用leave退出),不能使用use命令。
创建存储过程:
create procedure 存储过程的名字(in|out|inout 字段名1,in|out|inout 字段名2,in|out|inout 字段名3)
begin
。。。
end;
删除存储过程:
drop procedure 存储过程名;

题目加代码

1、在图书管理数据库中创建一个函数Count_voverdue,根据书号和借阅证号, 计算该用户的图书的超期天数,超期天数大于0,则返回实际天数,没有超期,返回整数0。

drop FUNCTION if exists Count_voverdue;
delimiter //
CREATE FUNCTION Count_voverdue(vloanno varchar(16),vbookno char(9))
######### Begin #########
returns tinyint
begin
declare vover_count tinyint;
declare vterm tinyint;
declare vborrowdate datetime;
select c.term into vterm from Class_User c,Users u
where c.classNo=u.classNo and u.loanNo=vloanno;
select borrowDate into vborrowdate from Loan where bookNo=vbookno;
set vover_count=datediff(sysdate(),vborrowdate)-vterm;
if vover_count>0 then
return vover_count;
else
return 0;
end if;
######### End #########
end //
delimiter ;

2.创建还书存储过程P_ReturnBook,输入参数为借阅证号和书号,在begin和end之间填入代码,完成以下功能。
(1)调用系统为我们创建好的函数Count_voverdue。该函数有两个输入参数,第一个参数为借阅证号,第二个参数为图书的书号。返回所借图书的超期天数(未超期返回值为0),
若超期天数大于0,则按照每天0.1元计算出罚款金额,并往Money表中添加一条罚款信息,罚款原因为“过期罚款”。
(2)删除Loan表中相关借阅记录;
(3)并往LoanHist中写入一条还书记录的信息。
(4)将所归还图书的状态bstatus修改为0(代表可借阅)

use library;
drop procedure if exists P_ReturnBook;
delimiter //
create procedure P_ReturnBook(vloanno varchar(16),vbookno char(9))
BEGIN
######### Begin #########
declare vover_date tinyint;
declare vborrowdate datetime;
set vover_date=Count_voverdue(vloanno,vbookno);
select borrowDate into vborrowdate from Loan where loanNo=vloanno and bookNo=vbookno;
if vover_date>0 then
insert into Money(loanNo,bookNo,amount,reason,billdate) values(vloanno,vbookno,0.1*vover_date,‘过期罚款’,sysdate());
end if;
delete from Loan where bookNo=vbookno and loanNo=vloanno;
insert into LoanHist(loanNo,bookNo,borrowDate,returnDate) values(vloanno,vbookno,vborrowdate,sysdate());
update Books set bstatus=‘0’ where bookNo=vbookno;
######### End ##########
END//
delimiter ;

1、在图书管理数据库中创建一个存储过程P_IsLoan,在用户借书之前,判断该用户能否借书。用户借阅证号和借阅图书的书号作为输入参数,
输出参数vflag为整数,有以下几种状态值:
(1)vflag为0,表示“该用户可以借阅此书”;
(2)vflag为1,表示此书已经预约或已经借出或不出借;
(3)vflag为2,表示此书不对该类用户出借,每种图书只对允许的用户类别出借(具体参见上方Books表的字段说明);
(4)vflag为3,表示“已达到借书上限”;
(5)vflag为4,表示“此用户存在超期未还图书”。

方法一
use library;
DROP PROCEDURE IF EXISTS P_IsLoan;
delimiter //
create procedure P_IsLoan(vloanno varchar(16),vbookno char(9),out vflag tinyint)
begin
######### Begin #########
declare vbstatus char(1);
declare vctr_no tinyint;
declare vterm tinyint;
declare vceilingnum tinyint;
declare vtotal_count tinyint;
declare voverdue_count int;
set vflag=0;
select bstatus,ctr_no into vbstatus,vctr_no from Books where bookNo=vbookno;
select term,ceilingNum into vterm,vceilingnum
from Class_User c,Users u
where c.classNo=u.ClassNo and u.loanNo=vloanno;
select count(datediff(sysdate(),borrowDate)>vterm),count(*) into voverdue_count,vtotal_count
from Loan where loanNo=vloanno;
if vbstatus=‘1’||vbstatus=‘2’||vbstatus=‘3’ then
set vflag=1;
end if;
if vctr_no=6||vctr_no=0 then
set vflag=2;
end if;
if vtotal_count>=vceilingnum then
set vflag=3;
elseif voverdue_count>0 then
set vflag=4;
end if;
######### End #########
end//
delimiter ;

方法二(与方法一的区别在于使用了标签label)
lable:begin
######### Begin #########
declare v_bstatus varchar(1);
declare loan_amount tinyint;
declare loan_max tinyint;
declare v_ctr tinyint;
declare v_cname varchar(20);
declare v_maxdate int;
select 0 into vflag;
select bstatus into v_bstatus from Books where Books.bookNo=vbookno;
IF(v_bstatus!=‘0’) then
select 1 into vflag;
leave lable;
end IF;
select Books.ctr_no into v_ctr from Books where Books.bookNo=vbookno;
IF(v_ctr=6||c_ctr=0) then
select 2 into vflag;
leave lable;
End IF;
select count(Loan.loanNo) into loan_amount from Loan where vloanno=Loan.loanNo;
select ceilingNum into loan_max from Class_User,Users where Users.loanNo=vloanno and Users.classNo=Class_User.classNo;
IF(loan_amount>=loan_max) then
select 3 into vflag;
leave lable;
end IF;
select term into v_maxdate from Loan,Class_User,Users where Loan.loanNo=vloanno and Class_User.classNo=Users.classNo and
Users.loanNo=Loan.loanNo;
IF EXISTS(select * from Loan where DateDIFF(SYSDATE(),borrowDate)>v_maxdate ) then
select 4 into vflag;
leave lable;
End IF;

2.创建P_LoanBook存储 过程,输入参数为借阅证号和书号,在begin和end之间填入代码。
调用前一关中我们已经创建好的存储过程P_IsLoan判断能否借书,并将P_IsLoan的输出参数作为本题中存储过程的输出参数vflag。
如果P_IsLoan输出参数Vflag等于0,表示可以出借,则在Loan表中写入该用户借阅图书的记录,
并将books表中该书的借阅状态修改为1,1代表已经借出。

use library;
drop procedure if exists P_LoanBook;
delimiter //
create procedure P_LoanBook(vloanno varchar(16),vbookno char(9),out vflag tinyint)
begin
######### Begin #########
call P_IsLoan(vloanno,vbookno,vflag);
if vflag=0 then
insert into Loan(bookNo,loanNo,borrowDate) values(vbookno,vloanno,sysdate());
update Books set bstatus=‘1’ where bookNo=vbookno;
end if;
######### End ##########
end//
delimiter ;

触发器:

理解触发器

触发器:①一种特殊的存储过程,与特定的一个表相连,当对表进行操作(insert、delete、update)时就会激活它执行。
②自动的,自动激活,不能直接调用,因而不能传递和接受参数,也不返回结果集。
③通常用来实现复杂的完整性约束。
④数据的完整性检查总是在触发器之前执行。
⑤表对任何动作可以有多个触发器。

创建触发器
create trigger 触发器的名字 before(或者after) insert(或者update或者delete) on 表名 for each row
begin
。。。
end;
解释:
before (after)表示在触发事件之前(后)
insert、update、delete为触发事件
注意:
触发器内不能使用动态SQL语句
删除表时,该表上建立的所有触发器一并删除
new代表新添加或修改后的行,old代表删除或修改之前的行。

题目加代码

1.创建一个触发器tri_returnbook,当一本书被还回时,从LOAN表中删除相应的借阅记录,
将该学生借阅这本书记录添加到LoadHist表中;并检查是否有用户在等待预约这本书:
如有则将这本书的借阅状况修改为 已经预约,并按照预约的日期先后,将最先预约的预约状态改为T;
如果没有人预约,则应该将此书的借阅状况修改为“可以借阅且尚未借出”(修改状态字段值)

use library;
drop TRIGGER if EXISTS tri_returnbook;
delimiter //
######### Begin #########
create trigger tri_returnbook
after delete on Loan
for each row
Begin
declare aISBN char(13);
set aISBN=(select ISBN from Books where Books.bookNo=old.bookNo);
insert into LoanHist (loanNo,bookNo,borrowDate,returnDate) values(old.loanNo,old.bookNo,old.borrowDate,sysdate());
if EXISTS(select * from Reservation,Books where Reservation.ISBN=Books.ISBN and Books.bookNo=old.bookNo) then
update Books set bstatus=‘3’ where Books.bookNo=old.bookNo;
update Reservation set rstatus=‘T’ where Reservation.ISBN=aISBN;
else
update Books set bstatus=‘0’ where Books.bookNo=old.bookNo;
end if;
End;//
######## End #########
delimiter ;
SELECT EVENT_MANIPULATION,EVENT_OBJECT_TABLE,ACTION_ORDER,ACTION_ORIENTATION,ACTION_TIMING
from information_schema.TRIGGERS
where TRIGGER_NAME=‘tri_returnbook’;

2.创建一个触发器tri_loan,当借书成功,修改该书的状态为“1”(代表已经借出),并检索是否有这个用户的预约该书的记录,如果有,则删除相应的预约记录
use library;
drop trigger if exists tri_loan;
delimiter //
######### Begin #########
create trigger tri_loan
after insert on Loan
for each row
begin
update Books set bstatus=‘1’ where Books.bookNo=new.bookNo;
if exists(select * from Reservation,Books where Reservation.ISBN=Books.ISBN and Books.bookNo=new.bookNo) then
delete from Reservation where Reservation.loanNo=new.loanNo;
end if;
end;//
######### End ##########
delimiter ;

3.创建一个触发器tri_fine,当读者还书时,如果超期罚款, 通过触发器在收费表中添加一条收费记录(0.1元每天)。
use library;
drop trigger if exists tri_fine;
delimiter //
######### Begin #########
create trigger tri_fine
after delete on Loan
for each row
Begin
declare over_date tinyint;
//不能用select A into B from 表C where…;
set over_date=(select datediff(sysdate(),old.borrowDate)-Class_User.term
from Class_User,Users
where Class_User.classNo=Users.classNo and Users.loanNo=old.loanNo);
if over_date>0 then
insert into Money(loanNo,bookNo,amount,reason,billdate) values(old.loanNo,old.bookNo,0.1*over_date,‘过期罚款’,sysdate());
end if;
End;
//
######### End ##########
delimiter ;

  • 27
    点赞
  • 105
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值