Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
91 views

Library Management System

This document describes the development of a library management system using a database management system. It includes an entity-relationship diagram, relational schema diagram, SQL queries to implement the system, and screenshots of the graphical user interface. Tables are created for books, students, employees and book issues. Values are inserted and various queries are written to retrieve information like students who borrowed books from a specific employee or count of books by subject. A trigger is created to limit students from borrowing more than 3 books and a procedure to display all books borrowed by a student.

Uploaded by

anudeep
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views

Library Management System

This document describes the development of a library management system using a database management system. It includes an entity-relationship diagram, relational schema diagram, SQL queries to implement the system, and screenshots of the graphical user interface. Tables are created for books, students, employees and book issues. Values are inserted and various queries are written to retrieve information like students who borrowed books from a specific employee or count of books by subject. A trigger is created to limit students from borrowing more than 3 books and a procedure to display all books borrowed by a student.

Uploaded by

anudeep
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

LIBRARY

MANAGEMENT
SYSTEM
DBMS ACTIVITY
TABLE OF CONTENTS

• Problem Description
• E-R Diagram
• Relational Schema Diagram
• Implementation using SQL Queries
• Snapshots of GUI
PROBLEM DESCRIPTION

• Library Management System - Manual process of keeping student records, book records,
account details, managing employee is very difficult. There are various problems also
faced by the student in library such as finding any particular book, information whether
book is available or not, searching of books using subject name etc. To eliminate these
problems we aim to develop a interactive portal for automating all theses as well as
various other tasks done by a librarian.
E-R DIAGRAM
RELATIONAL SCHEMA DIAGRAM
IMPLEMENTATION
USING SQL QUERIES
CREATING DATABASE

• Create Database
CREATE DATABASE library
DEFAULT CHARACTER SET = 'utf8mb4’;
use library;
CREATING REQUIRED TABLES

create table Employee ( create table Student (


empid varchar(20) primary key, rollno varchar(20) primary key,
name varchar(30), name varchar(30),
password varchar(30), password varchar(30),
dept varchar(30), dept varchar(30),
doj varchar(30), sem varchar(30),
sal varchar(30) batch varchar(30)
); );
CREATING REQUIRED TABLES

create table Book ( create table Issue (


bid varchar(20) primary key, bid varchar(20) primary key,
title varchar(30), issueto varchar(30),
subject varchar(30), issueby varchar(30)
author varchar(30), );
status varchar(30)
);
INSERTING VALUES INTO TABLES

INSERT INTO Employee INSERT INTO Student


VALUES('1','Suresh','qwerty','cse','16/01/2022','42000'); VALUES('1','Diya','qwerty','cse','5','a1');

INSERT INTO Employee INSERT INTO Student


VALUES('2','Mahesh','qwerty','ece','12/01/2021','53000'); VALUES('2','Vikram','qwerty','ece','8','b2');

INSERT INTO Employee INSERT INTO Student


VALUES('3','Ramesh','qwerty','eee','23/10/2019','64000'); VALUES('3','Charan','qwerty','eie','2','d1');

INSERT INTO Employee INSERT INTO Student


VALUES('4','Ram','qwerty','mech','17/08/2012','28000'); VALUES('4','Nani','qwerty','ise','6','a2');

INSERT INTO Employee INSERT INTO Student


VALUES('5','Veer','qwerty','ise','21/10/2010','25000'); VALUES('5','Vikrant','qwerty','chem','4','c1');
INSERTING VALUES INTO TABLES

INSERT INTO Book VALUES('12432','Mechanical INSERT INTO Issue VALUES('12432','3','1');


Engineering','Mechanical','Gwen Stacy','Aval');
INSERT INTO Issue VALUES('43543','2','5');
INSERT INTO Book VALUES('13142','Python Zero to Hero','python','Mary
Jane','Aval');
INSERT INTO Issue VALUES('13142','1','4');
INSERT INTO Book VALUES('43543','Introduction to
Programming','computer science','Harry Osborn','Aval'); INSERT INTO Issue VALUES('65356','5','2');

INSERT INTO Book VALUES('65356','Chemical Bonds','Chemistry','Ben INSERT INTO Issue VALUES('34632','4','3');


Parker','Aval');
INSERT INTO Issue VALUES('34331','1','3');
INSERT INTO Book VALUES('34632','Data Structures and
algorithms','Java','Haward Stark','Aval'); INSERT INTO Issue VALUES('34135','1','2');
INSERT INTO Book VALUES('34331','Computer
INSERT INTO Issue VALUES('41234','2','2');
Organisation','CSE','Albert','Aval');

INSERT INTO Book VALUES('34135','DBMS','CSE','Lucy Mayor','Aval');

INSERT INTO Book VALUES('41234','Software


Engineering','CSE','Hetmayer','Aval');
QUERIES

• Display names of Students whose books • Select all students who didn’t borrow a
are issued by employee 1 single book
select distinct(s.name) select *
from student s, employee e,issue i from student s
where e.empid=1 and where s.rollno
s.rollno=i.issueto; not in(select issueto from issue);
QUERIES

• Get count of number of books of each subject


select title,count(*) as No_of_Books
from Book b
group by title;
TRIGGER
ENSURES THAT NO STUDENT CAN BORROW MORE THAN THREE BOOKS.

CREATE TRIGGER issue_before_insert WHERE Issueto=NEW.Issueto


GROUP BY Issueto;
BEFORE INSERT ON Issue IF c=3 THEN
FOR EACH ROW SET msg = concat('Limit reached');
signal sqlstate '45000' set
BEGIN message_text = msg;
DECLARE c INT; END IF;
END
DECLARE msg VARCHAR(30);
SELECT count(*) INTO c
FROM Issue
PROCEDURE
DISPLAY ALL BORROWED BOOKS BY A PARTICULAR STUDENT

CREATE PROCEDURE get_all_borrowed_books(IN id INT)


BEGIN
SELECT *
FROM Book b
JOIN Issue i
ON b.bid=i.bid
WHERE i.issueto=id;
END
OUTPUT SNAPSHOTS
QUERY - 1
QUERY - 2
QUERY - 3
GUI SNAPSHOT
GUI SNAPSHOT
GUI SNAPSHOT
TRIGGER
PROCEDURE
THANK YOU…

• By -
A N V S ANUDEEP - 1SI19CS017
BASAVESH T J - 1SI19CS023
VINAY REDDY P - 1SI19CS141

You might also like