啦啊啦啦啦啊啦啦啦1

/*1*/
SELECT COUNT(*) FROM book WHERE AUTHOR ='刘刚';
/*2*/
SELECT * FROM book WHERE publish='人民邮电出版社';
/*3*/
SELECT COUNT(*) FROM book_borrow WHERE CONVERT(borrow_time,DATETIME) LIKE'2024-03-%';
/*4*/
INSERT INTO book(book_name,author,price,publish,book_classify_id,isbn,create_time) VALUES('疑难杂病临证手册(第2版)','余孟学',158,'河南科技出版社','R 医药 卫生','9787534989230',CURTIME());
/*5*/
SELECT user.user_name,book.book_name,book.publish,book_borrow.borrow_time,book_borrow.return_time
FROM book,book_borrow,USER
WHERE user_name='小影'AND user.id=book_borrow.user_id AND book_borrow.book_id=book.id;
/*6*/

CREATE VIEW user_book_borrow_view 
AS SELECT user.id,user.login_name,user.user_name,book.book_name,book.publish,book_borrow.borrow_time,book_borrow.return_time
FROM book,USER,book_borrow
WHERE user.id=book_borrow.user_id AND book_borrow.book_id=book.id;
/*7*/
CREATE INDEX booknameindex ON book(book_name);
/*8*/
CREATE INDEX bookpublishnameindex ON book(publish,book_name);
/*9*/
UPDATE USER SET dept_id=3 WHERE user_name='小刚';
/*10*/
DELETE FROM book WHERE book_name LIKE '%经济学%';
/*11*/
DELETE FROM book_borrow
WHERE user_id IN(
    SELECT id FROM USER WHERE user.user_name='小影'
)
/*12*/
SELECT book_name 
FROM book,book_borrow,book_lose 
WHERE book.id=book_borrow.book_id AND book_lose.borrow_id=book_borrow.id;
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值