This article was published as a part of the Data Science Blogathon.

Introduction
In this article, we will build Library Management System using MYSQL. We will build the database, which includes tables. Imagine that you go to the library, take a book, and just enter that book into the computer rather than entering your details and book details in a register. Isn’t it easy and convenient? Here comes the library management system. This system is handy for people going to the library and searching for their desired book and for the librarian to guide them and take care of these things. It ensures that everything works in systematic order, given that each person taking or returning books needs to enter the record in the system.

library management system
Source: Lovelycoding.org
Purpose of Library Management System
Library Management System is a system that shows all the available books and their count and also books taken by people, the date on which they took that particular book, expected date of return, late due fees, membership details, and so on. Everything will be crystal clear. There will be no ambiguity. It will be beneficial for both students and librarians.

This library management is very efficient and also cost-effective. It saves a lot of time for both librarians and also students. With this, manual work is reduced, requiring less staff and maintenance. This system is user-friendly and also very easy to use.

Analysis of Features
Firstly we need to take every user perspective; user means not only customers but also staff in the library. What are all the features each user requires?

We will start with features required by library staff


Become a Full Stack Data Scientist
Transform into an expert and significantly impact the world of data science.
Record while issuing books- When anyone takes a book, staff should be able to scan the barcode on the book and should be able to enter the record.
Profile editing- Staff should be able to edit the profile and the profiles of the people with membership in that library.
They should be able to keep track of books issued by them.
Should be able to ask, request, or demand the books from the people who took that if they crossed the due date.
They should be able to track books, their place, and so on.
If there occurs any change in the system, or if anyone else entered details or tried to access the system, staff should get the notification.
library management system
Source: Rovan Software Solutions

Next going to features required by a student

They should be able to create their account themselves
If their desired book is not available in the library, they should be able to request that particular book.
They should be able to receive notification if the due date for any particular book is exceeded.
By giving details of a particular book like the name of the book, author, and published by, they should be able to find the book’s place in the library.
A payment option should be there so that students can pay their membership fees, late fees, and so on.
In the following code, we will be using MYSQL and the names of some books so that they would be easy to understand.

Creating Tables
So our first step is to create tables. Let us create a database as db_LibraryManagement and then create all the required tables inside it.

CREATE PROC dbo.LibraryManagementSystemProcedure
AS CREATE DATABASE db_LibraryManagement
GO
CREATE TABLE table_publisher (
PublisherName VARCHAR(50) PRIMARY KEY NOT NULL,
PublisherAddress VARCHAR(100) NOT NULL,
PublisherPhone VARCHAR(20) NOT NULL,
);
Now let’s create a table for a book.

CREATE TABLE table_book (
BookID INT PRIMARY KEY NOT NULL IDENTITY (1,1),
Book_Title VARCHAR(100) NOT NULL,
PublisherName VARCHAR(100) NOT NULL
);
Similarly, create a table for the library branch.

CREATE TABLE table_library_branch (
library_branch_BranchID INT PRIMARY KEY NOT NULL IDENTITY (
library branch BranchName VARCHAR(100) NOT NULL, library_branch_BranchAddress VARCHAR(200) NOT NULL,
);
View the library branch table.

SELECT FROM table_library_branch
CREATE TABLE table_borrower (
CardNo INT PRIMARY KEY NOT NULL IDENTITY (100,1),
BorrowerName VARCHAR(100) NOT NULL,
BorrowerAddress VARCHAR(200) NOT NULL,
BorrowerPhone VARCHAR(50) NOT MILL,
);