Professional Documents
Culture Documents
GROUP-I
SECOND YEAR OF COMPUTER SCIENCE
FEBRUARY,2023
Library Management System
Team members
No Contents Pages
1 Project Description 1
2 Project Objective 2
3 ER Diagram 3
4 Tables 4-6
5 Views 7-8
6 SQL questions 8 - 15
Project Description
A school library management system is a project that manages and stores books information
electronically according to student needs. The system helps both students and library
manager to keep a constant track of all the books available in the library.
This system reduces manual work to a great extent allows smooth flow of library activities by
removing chances of errors in the details.
1
Project Objectives
The main objective of the Library Management System is discipline of the planning,
organizing and managing the library tasks. Our project aims at making the task of library
easy. Library Management is entering the records of new book and retrieving the details of
book available in the library. We can issue book to the library member and maintain their
records and can also checks how many books are issued and stock available in the library. In
the project we can maintain the late fine of library member who return the issued book after
the due date. The project is totally built at administrative end and thus only the administrator
is guaranteed the access.
To provide a friendly environment to maintain the details of books and library
members.
To maintain the circulation system using computers and to provide different reports.
To improve customers service through greater access to accurate information.
Greater accountability and transparency in operations.
2
ER Diagram For Library Management System
3
Student
4
Book
5
Borrowing
6
Overdue fee
7
Lost or damaged condition
1. Insert a new book into book table. book_id, name, author, category, price. Are
00011,”Little Bird”, “Min Lu”, “Novel”, 3700.
8
2. List all information about student who does not return the book.
select student.*
from student, borrowing
where borrowing.return_date is null and student.student_id=borrowing.student_id;
9
4. Find the ID and name of each student who has borrowed at least one book.
select student.student_id,name
from student, borrowing
where student.student_id=borrowing.student_id
group by borrowing.student_id
having count(borrowing.student_id)>=1;
5. Find the ID and name of each student who has borrowed every book that situation by
damaged.
select student.student_id,name
from student,borrowing
where student.student_id=borrowing.student_id and situation="damaged";
10
6. Find the name and author of book which the maximum price in the library.
select name,author
from book
where price = (select max(price) from book);
11
8. Find the book name and author which has been borrowed more than one time in that day.
select name,author
from borrowing,book
where borrowing.book_id=book.book_id and
loan_date in(select date_format(loan_date,"%Y-%m-%d")
from borrowing
group by loan_date
having count(loan_date)>1);
9. Find situation and book author using scalar subqueries which was borrowed by student_id
“10115”.
select situation,
(select author from book where book.book_id=borrowing.book_id) as author
from borrowing
where student_id=10115;
12
10. Write a query to display the book id, book name and author of the books whose author
name begins with ‘A’.
select book_id,name,author
from book
where author like "A%";
11. Write a query to display the student id, name of the students, book id and book name of
the books taken by them and order them by book id.
select student.student_id,student.name,book.book_id,book.name
from book,student,borrowing
where book.book_id=borrowing.book_id and student.student_id=borrowing.student_id
order by book_id;
13
12. Write a query to display the average price of books which is belonging to 'Novel' category
with alias name “AVERAGEPRICE”.
select avg(price) as AVERAGEPRICE
from book
group by category
having category="Novel";
14
14. Delete all data that has been damaged from borrowing.
delete from borrowing
where situation='damaged' ;
15