《图书馆借阅系统的数据库设计》一文探讨了如何高效组织与管理图书资料,通过合理规划数据库结构提升图书馆自动化服务效能。
图书馆借阅系统数据库设计
2.5.1 按借阅表查询历史借阅信息
用1表示已经归还,0表示未归还
```sql
select * from Borrow where Bis=0;
```
2.5.2 查询到期未还的所有借阅者记录 (借阅者编号,姓名,图书名称,借阅日期,应还日期)
用1表示已经归还,0表示未归还
```sql
select Reader.Rno,Reader.Rname,Book.Bname,Borrow.Bstart,Borrow.Bend from Reader,Book,Borrow where Reader.Rno=Borrow.Rno and Book.Bno=Borrow.Bno and Bis=0;
```
2.5.3 按出版的统计被借阅次数,结果按降序排列。若只要显示前三项,如何实现?
```sql
select Book.Bname,temp.Bno,num from BOOK,( select top 3 Borrow.Bno Bno,COUNT(Borrow.Rno) num from Borrow GROUP BY Borrow.Bno order by COUNT(Borrow.Rno) desc )temp where Book.Bno=temp.Bno;
```
以上为图书馆借阅系统数据库设计的一部分内容,包括查询历史借阅信息、到期未还的记录和统计被借阅次数等操作。