求 解答 谢谢
假定Oracle数据库中学生表为Student(id,studentname)、书籍表为Book(id,bookname)、学生借阅表为StudentBook(id,st...
假定Oracle数据库中学生表为Student(id,studentname)、书籍表为 Book(id,bookname)、学生借阅表为
StudentBook(id,studentid,bookid,borrowdate).请编写SQL语句查询:
1) 今年(2011年)从未借阅过的书籍名称清单
2) 累计借阅次数最多的前十本书,得到下列信息:书名,借阅次数 展开
StudentBook(id,studentid,bookid,borrowdate).请编写SQL语句查询:
1) 今年(2011年)从未借阅过的书籍名称清单
2) 累计借阅次数最多的前十本书,得到下列信息:书名,借阅次数 展开
展开全部
1)
select distinct bookname from Book where id not in
(select distinct bookid from StudentBook where borrowdate between '20110101000000' and '20111231235959')
2)
select top 10 a.bookname,count(b.bookid) as Qty from Book a, StudentBook b
where a.id=b.bookid
group by a.bookname
order by count(b.bookid) desc
select distinct bookname from Book where id not in
(select distinct bookid from StudentBook where borrowdate between '20110101000000' and '20111231235959')
2)
select top 10 a.bookname,count(b.bookid) as Qty from Book a, StudentBook b
where a.id=b.bookid
group by a.bookname
order by count(b.bookid) desc
舒仕福
2023-07-11 广告
2023-07-11 广告
eor有以下两种含义:1. eor是计算机术语,表示二进制异或运算。在计算机逻辑运算中,算术逻辑执行二进制按位异或运算,两数执行异或后相同位结果为0,不同位结果为1。2. eor也表示在任何时期,向地层中注入流体、能量,以提高产量或采收率的...
点击进入详情页
本回答由舒仕福提供
展开全部
select bookname from Book
where id not in (select bookid from StudentBook);
select bookid,count(id) from StudentBook s join Book b
on s.bookid=b.id grouping by bookid
order by count(id) having rownum < 11
where id not in (select bookid from StudentBook);
select bookid,count(id) from StudentBook s join Book b
on s.bookid=b.id grouping by bookid
order by count(id) having rownum < 11
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
1.They'll probably make more cartoons in the future.
2.The first cartoons told stories using pictures.
3.Peter drew the pictures of flowers on the book.
4.It was the first cartoon film with sound.
此题如仍有疑问,欢迎追问!
满意请采纳。
2.The first cartoons told stories using pictures.
3.Peter drew the pictures of flowers on the book.
4.It was the first cartoon film with sound.
此题如仍有疑问,欢迎追问!
满意请采纳。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这么简单的sql 你自己考虑考虑吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询