Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
8 views29 pages

DBMS Project

DBMS project report

Uploaded by

krishaloydutta35
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views29 pages

DBMS Project

DBMS project report

Uploaded by

krishaloydutta35
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

SUBMITTED BY:

1. GAURAV HAZARIKA .
Roll no:

2. KRISHALOY DUTTA .
Roll no:

3. SARSHAT BARUAH .
Roll no:

4. RUPAK GOGOI .
Roll no:
CERTIFICATE

This is to certify that Gaurav Hazarika , Krishaloy Dutta ,


Sharshat Baruah and Rupak Gogoi of B.C.A. 4th Semester from
Jagannath Barooah University , Jorhat have completed this project
entitled “Library Management System” under my supervision
and guidance as part of the assignment to be completed under
B.C.A. 4th Semester Course .

Prof. Gautam Kumar Adhyapak(HOD)


Department of Computer Science .
J.B. University , Jorhat .
TABLE OF CONTENTS

Sl No. Content Page No.

1 INTRODUCTION 4
2 OBJECTIVE 5-6
3 DATA TYPES & ITS DESCRIPTION 7

4 DATA REQUIREMENTS
• Entities 8
• Attributes 8-9
• Relationships - Cardinality 10-11
5 ENTITY-RELATIONSHIP DIAGRAM 12-13
6 CREATING DATABASE USING MYSQL 14-19
7 INSERTING DATA IN TABLES 20-25
8 TEST-CASE QUERIES 26-28
9 CONCLUSION 29
1.INTRODUCTION

A library is a collection of organised information and resources


which is made accessible to a well-defined community for borrowing or reference
sake. The collection of the resources and information are provided in digital or
physical format in either a building/room or in a virtual space or even both.
Library's resources and collections may include newspapers, books, films, prints,
maps, CDs, tapes, videotapes, microform, database etc. The main aim of this
system is to develop a new programmed system that will conveying ever lasting
solution to the manual base operations and to make available a channel through
which staff can maintain the record easily and customers can access the
information about the library at whatever place they might find themselves.

Library Management System allows the user to store the book


details and the customer details. The system is strong enough to withstand
regressive yearly operations under conditions where the database is maintained
and cleared over a certain time of spend . The implementation of the system in the
organisation will considerably reduce data entry, time and also provide readily
calculated reports.
2.OBJECTIVE

A library management system (LMS) serves multiple objectives, aimed


at efficiently organizing and managing library resources while providing seamless
services to users. Here are some key objectives of a library management system:
1. Efficient Resource Management: An LMS aims to effectively manage various
resources of the library including books, journals, multimedia materials, and
digital resources. It helps in cataloging, classification, and shelving of materials
for easy access and retrieval.
2. User Services: The primary objective of an LMS is to provide efficient services
to library users. This includes features like online catalog search, reservation,
renewal, and online access to digital resources. The system should facilitate easy
borrowing and returning of materials, as well as provide assistance in research and
reference queries.
3. Automation: Automation is a key objective of an LMS. It aims to streamline
library operations by automating routine tasks such as cataloging, circulation,
acquisition, and inventory management. This helps in reducing manual effort and
improving overall efficiency.
4.Data Management: LMS focuses on maintaining accurate and up-to-date
information about library resources, users, and transactions. It ensures proper
organization and storage of data for easy retrieval and analysis. Data management
also includes generating reports and statistics for decision making and evaluation
purposes.
5. Integration with Other Systems: An LMS should be capable of integrating
with other systems such as institutional repositories, digital libraries, and online.
databases. This integration enhances the accessibility of resources and provides a
seamless experience to users
6. Security and Access Control: Security is a critical objective of an LMS to
protect library resources and user data from unauthorized access and misuse. It
includes implementing access control mechanisms, encryption, and regular data
backups to safeguard information.
7. Customization and Scalability: LMS should be customizable to meet the
specific requirements of different types of libraries such as academic, public, or
special libraries. It should also be scalable to accommodate the growing needs of
the library in terms of collection size, user base, and technological advancements.
8. Cost-effectiveness: Implementing an LMS should result in cost savings for the
library by reducing manual labour, minimizing errors, and optimizing resource
utilization. It should provide a good return on investment by improving efficiency
and enhancing user satisfaction.
Overall, the objectives of a library management system revolve around
enhancing the quality of library services, optimizing resource utilization, and
providing a user-friendly experience to patrons.
3.DATA TYPES & ITS DESCRIPTION

INT: Used for integer values. It’s commonly used for identifiers, such as primary
and foreign keys.
VARCHAR: Variable-length character string. It’s used for storing alphanumeric
data of variable length.
DATE: Used for date values. It stores date information in the format ‘YYYY-
MM-DD’.

Let’s describe each data type:

INT: Suitable for storing whole numbers, typically used for primary and foreign
keys because they are often auto-incremented integers.
VARCHAR: Ideal for storing variable-length strings, such as names, titles, and
email addresses. The number in parentheses specifies the maximum length of the
string that can be stored.
DATE: Specifically designed to store dates. It’s suitable for storing dates like
issue date, due date, and return date in transactions.

These data types are chosen to ensure efficient storage and retrieval
of data, as well as to enforce data integrity through appropriate constraints such as
primary keys, foreign keys, and uniqueness constraints.
4.DATA REQUIREMENTS

Entities:
▪ BOOKS
▪ STUDENTS
▪ LIBRARIANS
▪ PUBLISHERS
▪ ISSUE_STATUS
▪ RETURN_STATUS
▪ TRANSACTION
Attributes:
❖ BOOKS
➢ Book_id
➢ Title
➢ Author
➢ Total_copies
➢ Available_copies
➢ Publisher_id

❖ STUDENTS
➢ Student_id
➢ Name
➢ Phone_number
❖ PUBLISHERS
➢ Publisher_id
➢ Name
❖ LIBRARIANS
➢ Librarian_id
➢ Name
➢ Phone_number

❖ ISSUE_STATUS
➢ Issue_id
➢ Student_id
➢ Issued_book_name
➢ Issue_date
➢ Book_id

❖ RETURN_STATUS
➢ Return_id
➢ Student_id
➢ Returned_book_name
➢ Return_date
➢ Book_id
❖ TRANSACTIONS
➢ Transaction_id
➢ Book_id
➢ Student_id
➢ Librarian_id
➢ Issue_date
➢ Return_date
➢ Issue_id
➢ Return_id
Relationships-cardinality:
The relationships-cardinality of above entities are as follows:

1. Books (1:M) Publishers:


- Each book is published by exactly one publisher. (1 Publisher)
- Each publisher can have multiple books. (M Books)

2. Issue_Status (M:1) Students:


- Each issue status record is associated with exactly one student who issued the book. (1
Student)
- Each student can have multiple issue status records. (M Issue Statuses)

3. Return_Status (M:1) Students:


- Each return status record is associated with exactly one student who returned the book.
(1 Student)
- Each student can have multiple return status records. (M Return Statuses)

4. Transaction (M:1) Books:


- Each transaction record is associated with exactly one book. (1 Book)
- Each book can have multiple transaction records. (M Transactions)

5. Transaction (M:1) Students:


- Each transaction record is associated with exactly one student. (1 Student)
- Each student can have multiple transaction records. (M Transactions)
6. Transaction (M:1) Librarians:
- Each transaction record is associated with exactly one librarian. (1 Librarian)
- Each librarian can have multiple transaction records. (M Transactions)

7. Transaction (1:1) Issue_Status:


- Each transaction record is associated with exactly one issue status. (1 Issue Status)
- Each issue status can have exactly one transaction record. (1 Transaction)

8. Transaction (1:1) Return_Status:


- Each transaction record is associated with exactly one return status. (1 Return Status)
- Each return status can have exactly one transaction record. (1 Transaction)

9. Issue_Status (1:1) Books:


- Each issue status record is associated with exactly one book that was issued. (1 Book)
- Each book can have exactly one issue status record. (1 Issue Status)

10. Return_Status (1:1) Books:


- Each return status record is associated with exactly one book that was returned. (1
Book)
- Each book can have exactly one return status record. (1 Return Status)
5.ENTITY-RELATIONSHIP DIAGRAM

The Entity Relational Model is a model for identifying entities to be


represented in the database and representation of how those entities are related.
The ER data model specifies enterprise schema that represents the overall logical
structure of a database graphically.
The Entity Relationship Diagram explains the relationship among the
entities present in the database. ER models are used to model real-world objects
like a person, a car, or a company and the relation between these real-world
objects. In short, the ER Diagram is the structural format of the database.

Symbols Used in ER Model:


Figure Symbols Represents
Rectangles represent
Rectangle Entities in the
E-R diagram .
Ellipses represent
Ellipse Attributes in the ER
diagram .
Diamonds represent
Diamond Relationships among
Entities.
Lines represent attributes to
Lines entities and entity sets with
other relationship types.
Double Double Rectangle
Rectangle represents a Weak Entity.

Fig: Symbols used in ER Diagram.


E-R diagram for library management system

*Librarian_id

Name
Phone_no
Nam
nnName
LIBRARIANS
en
Author
r
maintains *Book_id

BOOKS
Total_copies
manages

manages Title
Returned_book_name
Available_copies

Return_date

*Issue_id publishes
Issue_date
RETURN STATUS

ISSUE STATUS
*Return_id

PUBLISHERS
return Issued_book_name
issue

Name
Name

record record *Publisher_id

STUDENTS

*Student_id
TRANSACTION
Phone_no

*Transaction_id
6.CREATING DATABASE USING MYSQL

To create a database in MySQL, you can use the CREATE DATABASE


statement. Here's how you can create a database named
library_management_system:
mysql> create database library_management_system;

Once you've created the database, you can switch to that database using the USE
statement:
mysql> use library_management_system;

CREATING TABLES:
After switching to the database, you can create tables within it. For creating tables, we use
the following statement:
mysql>CREATE TABLE publishers (
> publisher_id INT NOT NULL PRIMARY KEY,
> name VARCHAR(250) NOT NULL
> );
mysql>CREATE TABLE books (
> book_id INT NOT NULL PRIMARY KEY,
> title VARCHAR(250) NOT NULL,
> author VARCHAR(250) NOT NULL,
> total_copies INT NOT NULL,
> available_copies INT NOT NULL,
> publisher_id INT,
> FOREIGN KEY (publisher_id) REFERENCES publishers(publisher_id)
> );

To describe a table in MySQL, you can use the DESCRIBE statement or its alias DESC. Here's how
you can use it:
Now we create the other tables for the library management system project is given below:

mysql>CREATE TABLE students (


> student_id INT NOT NULL PRIMARY KEY,
> name VARCHAR(250) NOT NULL,
> phone_number VARCHAR(15)
> );

mysql> CREATE TABLE librarians (


> librarian_id INT NOT NULL PRIMARY KEY,
> name VARCHAR(250) NOT NULL,
> phone_number VARCHAR(15)
> );
mysql> CREATE TABLE issue_status (
> issue_id INT NOT NULL PRIMARY KEY,
> student_id INT,
> issued_book_name VARCHAR (250) NOT NULL,
> issue_date DATE NOT NULL,
> FOREIGN KEY (student_id) REFERENCES students(student_id)
> );

mysql> CREATE TABLE return_status (


> return_id INT NOT NULL PRIMARY KEY,
> student_id INT,
> returned_book_name VARCHAR(250) NOT NULL,
> return_date DATE NOT NULL, FOREIGN KEY (student_id) REFERENCES
students(student_id));
mysql>CREATE TABLE transactions (
> transaction_id INT NOT NULL PRIMARY KEY,
> book_id INT,
> student_id INT,
> librarian_id INT,
> issue_date DATE ,
> return_date DATE,
> issue_id INT,
> return_id INT,
> FOREIGN KEY (book_id) REFERENCES books(book_id),
> FOREIGN KEY (student_id) REFERENCES students(student_id),
> FOREIGN KEY (librarian_id) REFERENCES librarians(librarian_id),
> FOREIGN KEY (issue_id) REFERENCES issue_status(issue_id),
> FOREIGN KEY (return_id) REFERENCES return_status(return_id)
> );
mysql> DESC transactions;
7.INSERTING DATA INTO TABLES:

Inserting values into publishers table:


mysql> insert into publishers values (101,"Vintage International");
mysql> insert into publishers values (102, "Random House");
mysql> insert into publishers values (103," HarperCollins");
mysql> insert into publishers values (104,"Free Press");
mysql> insert into publishers values (105,"Mariner Books");
mysql> insert into publishers values (106,"Picador");
mysql> insert into publishers values (107,"Grove Press");
mysql> insert into publishers values (108,"Penguin Books");
mysql> insert into publishers values (109,"Westland");
mysql> insert into publishers values (110,"Faber and Faber");
Inserting values into books table:
mysql>insert into books values (1001,"Midnight’s Children","Salman Rushdie",
150,150,101);
mysql>insert into books values (1002,"The God of Small Things","Arundhati
Roy",125,120,102);
mysql>insert into books values (1003,"A Suitable Boy","Vikram Seth",140,140,103);
mysql>insert into books values (1004,"The White Tiger","Aravind Adiga",100,97,104);
mysql>insert into books values (1005,"Interpreter of Maladies","Jhumpa
Lahiri",70,70,105);
mysql>insert into books values (1006,"The Palace of Illusions","Chitra Banerjee
Divakaruni",160,155,106);
mysql>insert into books values (1007,"Train to Pakistan","Khushwant
Singh",110,107,107);
mysql>insert into books values (1008,"The Guide","R.K. Narayan",140,140,108);
mysql>insert into books values (1009,"The Immortals of Meluha","Amish
Tripathi",130,128,109);
mysql>insert into books values (1010,"English, August: An Indian Story","Upamanyu
Chatterjee",90,90,110);
Inserting values into students table:
mysql> insert into students values(4000,"Krish",8011456931);
mysql> insert into students values (4003,"Gaurav",9658475896);
mysql> insert into students values (4006,"Sarshat",8596374586);
mysql> insert into students values (4009,"Rupak",7006985546);
mysql> insert into students values (4012,"Rahul",8965856953);
mysql> insert into students values (4015,"Shiv",9651246321);

Inserting values into librarians table:


mysql> insert into librarians values(2008,"Madhav",8017756931);
mysql> insert into librarians values (2005,"Laxman",9633475896);
mysql> insert into librarians values (2001,"Gopal",8595574586);
Inserting values into issue_status table:

mysql> insert into issue_status values(301,4000,"The White Tiger",'2024-03-24');


mysql> insert into issue_status values (303,4000,"Midnight's Children",'2024-04-21');
mysql> insert into issue_status values (309,4003,"The Imortals of Meluha",'2024-03-28');
mysql> insert into issue_status values (302,4003,"The God of Small Things",'2024-02-
22');
mysql> insert into issue_status values (305,4006, "The Palace of Illusions",'2023-12-16');
mysql> insert into issue_status values (304,4009,"The White Tiger",'2024-04-21');
mysql> insert into issue_status values (306,4012,"The Guide",'2023-12-27');
mysql> insert into issue_status values (307,4015,"The Imortals of Meluha",'2024-02-27');
Inserting values into return_status table:

mysql> insert into return_status values (407,4000,"The White Tiger",'2024-03-29');


mysql> insert into return_status values (408,4000,"Midnight's Children",'2024-05-03');
mysql> insert into return_status values (405,4003,"The Immortals of Meluha",'2024-04-
03');
mysql> insert into return_status values (406,4003," The God of Small Things",'2024-03-
10');
mysql> insert into return_status values (402,4006, "The Palace of Illusions",'2023-12-
22');
mysql> insert into return_status values (404,4009,"The White Tiger",'2024-05-02');
mysql> insert into return_status values (403,4012,"The Guide",'2024-01-02');
mysql> insert into return_status values (401,4015,"The Immortals of Meluha",'2024-03-
20');
Inserting values into transactions table:

mysql> insert into transactions values (111001,1004,4000,2001,'2024-03-24','2024-03-


29',301,407);
mysql> insert into transactions values (111005,1001,4000,2005,'2024-04-21','2024-05-
03',303,408);
mysql> insert into transactions values (111024,1009,4003,2001,'2024-03-28',' 2024-04-
03',309,405);
mysql> insert into transactions values (111051,1002,4003,2008,'2024-02-22','2024-03-
10',302,406);
mysql> insert into transactions values (111099,1006,4006,2005,'2023-12-16','2023-12-
22',305,402);
mysql> insert into transactions values (111203,1004,4009,2001,' 2024-04-21','2024-05-
02',304,404);
mysql> insert into transactions values (111155,1008,4012,2008,' 2023-12-27',' 2024-01-
02',306,403);
mysql> insert into transactions values (111233,1009,4015,2005,'2024-02-27','2024-03-
20',307,401);
8. TEST-CASE QUERIES

1. Count the total number of books:


mysql> select count (*) as total_books from books;

2. List all book titles and their authors:


mysql> select title, author from books;
3. Find the books that are currently available and title starts with ‘T’:
mysql> select title , available_copies from books where available_copies >0 and title like
“T%”;

4. Modify the student name “Shiv” to a new name “Ram”:


mysql> update students set name="Ram" where name="Shiv";
5. Show the total number of copies and available copies of books:
mysql> select sum(total_copies),sum(available_copies) from books;

6. List the name of all books along with its publishers:


mysql> create view book_details as select b.title,p.name from books b , publishers p
where b.publisher_id=p.publisher_id;

7. List the details of transaction in ascending order of issue date:


mysql> select * from transactions order by issue_date;
9. CONCLUSION

• SQL database management application which is very well


used in the modern world in organising and manipulating a
database.

• Through SQL doesn’t have the GUI interface like Microsoft


access is having and they all manage the database comfortable.

• This project shows how to create tables in SQL and how to


create simple data manipulation language and data definition
language with how to execute them.

• It also shows how relationships are established with the


concepts of primary and foreign key within a table.

• Lastly, the project shows how queries are created in SQL


server, queries like create command, view, update, alter etc.

~≤(✿◕‿◕✿)≥~

You might also like