Blood Bank Management System Report
Blood Bank Management System Report
MANAGEMENT
Project submission for:- SYSTEM
Course Number/Section: MIS 6326.501 85761
Course Title: Data Management
Term: Fall 2018
By:
1. Siri Chandana Reddy Reddy Reddy
(Responsible for Introduction, Literature Work, ER diagram
and SQL implementation)
2. Ashwin Rathore
(Responsible for Relationship schema, ER diagram and SQL
implentation)
3. Yashvardhan Rathi
(Responsible for ER diagram, Normalization, References
and SQL implementation)
4. Manoj Saravanan
(Responsible for Relationship schema, Normalization and
SQL implementation.
5. Sukanth Rajan
(Responsible for ER Diagram, Normalization, conclusion
and SQL implementation)
Page |1
INDEX
TOPIC PAGE NO.
INTRODUCTION 3
LITERATURE WORK 4
ER DIAGRAM USING CREATLY 5
AND RELATION BETWEEN THE
ENTITIES
INFORMATION OF ENTITIES 6-7
RELATIONSHIP BETWEEN 7-8
ENTITIES
RELATIONAL SCHEMAS 8 - 11
ER DIAGRAM WITH TABLES 11
NORMALIZATION 12 -14
TABLES AFTER NORMALIZATION 15 - 19
ER DIAGRAM AFTER 19
NORMALIZATION
SQL IMPLEMENTATION 20 - 25
SAMPLE SQL QUERIES 25 - 27
CONCLUSION 28
REFERENCES 28
Page |2
INTRODUCTION
Blood banks collect, store and provide collected blood to the patients who are in need of blood.
The people who donate blood are called ‘donors’. The banks then group the blood which they
receive according to the blood groups. They also make sure that the blood is not contaminated.
The main mission of the blood bank is to provide the blood to the hospitals and health care
systems which saves the patient’s life. No hospital can maintain the health care system without
pure and adequate blood.
The major concern each blood bank has is to monitor the quality of the
blood and monitor the people who donates the blood, that is ‘donors’. But this a tough job. The
existing system will not satisfy the need of maintaining quality blood and keep track of donors.
To overcome all these limitations we introduced a new system called ‘Blood Donation
Management System’.
The ‘Blood Bank Management System’ allows us to keep track of quality
of blood and also keeps track of available blood when requested by the
acceptor. The existing systems are Manual systems which are time consuming and not so
effective. ‘Blood Bank Management system’ automates the distribution of blood. This database
consists of thousands of records of each blood bank.
By using this system searching the available blood becomes easy and saves
lot of time than the manual system. It will hoard, operate, recover and analyze information
concerned with the administrative and inventory management within a blood bank. This system
is developed in a manner that it is manageable, time effective, cost
effective, flexible and much man power is not required.[4]
Page |3
LITERATURE WORK
‘Blood Donation Management system’ is similar to ‘Organ Donation Management
System’ and ‘Charity Management System’ databases.
‘Organ donation management system’ is a database that automates the organ donation to the patients
who are in need of it. Each hospital maintains the ‘Organ Donation Management System’. This system
keeps track of organs available in the hospital to donate them to the patients. This system also contains
donors and acceptors. So this system is similar to ‘Blood Bank Management System’. [1]
‘Charity Management System’ keeps track of the donation of money to different organizations which
are in need of it. Here in this system, Donor is a person who donates money and acceptor is an
organization who requests for money or to whom the money is donated. This database contains
thousands of records to whom the money is donated by a person. This system is similar to ‘Blood Bank
Management System’ because the functioning is very similar when compared. [2]
Page |4
ER DIAGRAM USING CREATLY AND RELATION BETWEEN
THE ENTITIES [7]
Page |5
INFORMATION OF ENTITIES
In total we have eight entities and information of each entity is mentioned below:-
Page |6
In the data base, under Hospital_Info entity we will store the information of hospitals. In this
hosp_ID and hosp_needed_Bgrp toether makes the primary key. We will store hospital name
and the blood quantity reqiured at the hospital.
The relationship with Recording staff and Donor is 1 to many. That’s why primary key of
Recording staff is used as a foreign key in Donor.
The relationship with City and Donor is 1 to many. That’s why primary key of City is used as a
foreign key in Donor.
Page |8
Recipient Table:
The relationship with Recording staff and Blood Recipient is 1 to many. That’s why primary key
of Recording staff is used as a foreign key in Blood Recipient.
The relationship with City and Blood Recipient is 1 to many. That’s why primary key of City is
used as a foreign key in Blood Recipient.
The relationship with Blood Bank Manager and Blood Recipient is 1 to many. That’s why primary
key of Blood Specimen is used as a foreign key in Blood Recipient.
City Table:
The relationship between City and Recipients, Donor, Hospital info are all of 1 to many. So that’s
why primary key of City is used as a foreign key in Recipients, Donor and Hospital info.
The relationship between Recording Staff and Blood Donor, Recipients are all of 1 to many.
That’s why the primary key of Recording staff is used as a foreign key in Donor and Recipient.
Page |9
Blood Specimen Table:
The relationship with Disease finder and Blood Specimen is 1 to many. That’s why primary key of
Disease finder is used as a foreign key in Blood Specimen.
The relationship with Blood Bank manager and Blood Specimen is 1 to many. That’s why primary
key of Blood Bank manager is used as a foreign key in Blood Specimen
The relationship with Disease finder and Blood Specimen is of 1 to many. Therefore, the
primary key of Disease finder is used as a foreign key in Blood Specimen.
The relationship between Blood Bank Manager and Blood Specimen, Recipient, Hospital info
are all of 1 to many. So therefore, the primary key of Blood Bank Manager is used as a foreign
key in Blood Specimen, Recipient and Hospital info.
P a g e | 10
Hospital info Table:
The relationship with City and Hospital info is 1 to many. That’s why primary key of City is used
as a foreign key in Hospital info.
The relationship with Blood Bank Manager and Hospital info is 1 to many. That’s why primary
key of Blood Bank manager is used as a foreign key in Hospital info.
ER DIAGRAM WITH
TABLES
P a g e | 11
NORMALIZATION
Normalization Rule
Normalization rules are divided into the following normal forms:
1. First Normal Form
2. Second Normal Form
3. Third Normal Form
{bd_Id} = > {bd_name} (functional dependency exists, because two different bd_name
do not correspond to the same bd_Id).
{bd_ID} = > {bd_sex} (functional dependency exists).
{bd_ID} = > {bd_age} (functional dependency exists).
{bd_ID} = > {bd_reg_date} date (functional dependency exists).
{bd_ID} = > {reco_id} (functional dependency exists).
P a g e | 12
{bd_ID} = > {city_id} (functional dependency exists).
{bd_ID} = > {bd_Bgroup} (functional dependency exists).
As the attributes of this table does not have sub attributes, it is in first normal form.
Because every non-primary key attribute is fully functionally dependent on the primary
key of the table and it is already in first normal form, this table is now in second normal
form.
Since the table is in second normal form and no non-primary key attribute is transitively
dependent on the primary key, the table is now in 3NF.
{M_id} = >{m_name}
{M_id} = > {m_phNo} (functional
dependency exists)
P a g e | 14
TABLES AFTER
NORMALIZATION
BB_Manager:
Blood_Donor:
P a g e | 15
BloodSpecimen:
City:
P a g e | 16
DiseaseFinder:
Hospital_Info_1:
P a g e | 17
Hospital_Info_2:
Recipient:
P a g e | 18
Recording_Staff:
ER DIAGRAM AFTER
NORMALIZATION
P a g e | 19
SQL
IMPLEMENTATION
The implementation on SQL Server is given below [3] [5] [6] [8]:
CREATE TABLE
BB_Manager ( M_id int
NOT NULL,
mName varchar(max) NOT
NULL, m_phNo bigint
-- CONSTRAINT Mid_pk
PRIMARY KEY (M_id)
);
P a g e | 20
CREATE TABLE
Blood_Donor ( bd_ID
int NOT NULL,
bd_name varchar(max) NOT
NULL, bd_age varchar(max),
bd_sex varchar(max),
bd_Bgroup
varchar(10),
bd_reg_date date,
reco_ID int NOT
NULL, City_ID int
NOT NULL
-- CONSTRAINT
bdID_pk PRIMARY KEY
(bd_ID)
);
select * from
Blood_Donor CREATE
TABLE BloodSpecimen
( specimen_number
INSERT int
into BloodSpecimen
NOT NULL, 'B+',
VALUES(1001,
b_group
1,11,101),varchar(10) NOT
(1002,
NULL, 'O+',
status1,12,102),
int,
(1003, 'AB+',
dfind_ID 1,11,102),
int NOT
(1004,
NULL, 'O-', 1,13,103),
M_id int NOT
(1005,
NULL 'A+', 0,14,101),
CONSTRAINT
(1006, 'A-', 1,13,104),
specimenumber_pk
(1007, 'AB-', 1,15,104),
PRIMARY
(1008, KEY 0,11,105),
'AB-',
(specimen_number)
(1009, 'B+', 1,13,105),
);
(1010, 'O+', 0,12,105),
(1011, 'O+', 1,13,103),
(1012, 'O-', 1,14,102),
(1013, 'B-', 1,14,102),
(1014, 'AB+', 0,15,101);
Select * from
BloodSpecimen
P a g e | 21
CREATE TABLE City
( City_ID int NOT NULL,
City_name varchar(max) NOT NULL,
-- CONSTRAINT CityID_pk PRIMARY KEY
(City_ID)
);
CREATE TABLE
DiseaseFinder
( dfind_ID int NOT
NULL,
dfind_name varchar(max) NOT
NULL, dfind_PhNo bigint
-- CONSTRAINT dfindID_pk
PRIMARY KEY (dfind_ID)
);
INSERT into DiseaseFinder
VALUES(11,'Peter',469380422
3), (12,'Park',4693804223),
(13,'Jerry',4693804223),
(14,'Mark',4693804223),
(15,'Monika',4693804223);
select * from
DiseaseFinder
P a g e | 22
CREATE TABLE
Hospital_Info_1 ( hosp_ID
int NOT NULL,
hosp_name varchar(max) NOT
NULL, City_ID int NOT NULL,
M_id int NOT NULL
primary
key(hosp_ID)
-- CONSTRAINT
hospID_pk PRIMARY
KEY (hosp_ID)
);
INSERT into
Hospital_Info_1
VALUES(4,'Baylor',1400,10
4),
(5,'Charlton',1800,103),
(6,'Greenoaks',1300,106),
(7,'Forestpark',1300,102)
,
(8,'Parkland',1200,106),
(9,'Pinecreek',1500,109)
CREATE TABLE
,
Hospital_Info_2 ( hosp_ID
(10,'WalnutHill',1700,10
int NOT NULL,
5);
hosp_name varchar(max)
NOT NULL,
select * from
hosp_needed_Bgrp
Hospital_Info_1
varchar(10),
hosp_needed_qnty int
primary
key(hosp_ID,hosp_needed_Bg
rp)
-- CONSTRAINT hospID_pk
PRIMARY KEY (hosp_ID)
);
INSERT into
P a g e | 23
Hospital_Info_2
VALUES(3,'NYU','A+',0),
(3,'NYU','AB+',0),
(3,'NYU','B+',10),
(3,'NYU','AB-',0);
INSERT into
Hospital_Info_2
VALUES(4,'Baylor','A+',1
0),
(5,'Charlton','B+',30),
(4,'Baylor','A-',40),
(7,'Forestpark','B-',40)
,
(8,'Parkland','B+',10),
(9,'Pinecreek','AB-',20)
;
CREATE
select TABLE
* from
Recipient ( reci_ID
Hospital_Info_2
int NOT NULL,
reci_name varchar(max) NOT
NULL, reci_age varchar(max),
reci_Brgp varchar(max),
reci_Bqnty float,
reco_ID int NOT
NULL, City_ID int
NOT NULL, M_id int
NOT NULL, reci_sex
varchar(max),
reci_reg_date date
-- CONSTRAINT
reciid_pk PRIMARY
KEY (reci_id)
);
1. Create a View of recipients and donors names having the same blood group registered on the
same date.
CREATE VIEW Blood_Recipient_SameBGrp;
AS
select
Blood_Donor.bd_name,Recipient.reci
_name,reco_Name from
Recording_Staff
inner join Blood_Donor on Recording_Staff.reco_ID =
Blood_Donor.reco_ID inner join Recipient on
Recording_Staff.reco_ID = Recipient.reco_ID where
Blood_Donor.bd_Bgroup = Recipient.reci_Brgp and
Blood_Donor.bd_reg_date = Recipient.reci_reg_date
P a g e | 25
Output:
select* from
Blood_Recipient_SameBGrp;
2. Show the blood specimen verified by disease finder Mark which are pure (status=1).
Select specimen_number,b_group from
BloodSpecimen,DiseaseFinder WHERE BloodSpecimen.dfind_ID=
DiseaseFinder.dfind_ID AND dfind_name='Mark' AND status=1
Output:
3. Show the pure blood specimen handled by BB_Manager who also handles a recipient needing
the same blood group along with the details of the BB_Manager and Recipient.
select BB_Manager.M_id,mName,Recipient.reci_name,
Recipient.reci_Brgp,b_group from BB_Manager,Recipient,BloodSpecimen
where Recipient.M_id = BloodSpecimen.M_id and Recipient.reci_Brgp =
BloodSpecimen.b_group
and status = 1
Output:
P a g e | 26
4. Show the donors having the same blood groups required by the recipient staying in the same
city along with recipient details.
Output:
P a g e | 27
CONCLUSION
Our project well addressed the limitations of the existing system. We designed well organized database
management system which is a challenging job in this era. We have built a database for a Blood Bank
using Microsoft SQL Server. Before implementing the database, in the design phase, we have explored
various features, operations of a blood bank to figure out required entities, attributes and the
relationship among entities to make an efficient Entity Relationship Diagram(ERD). After analyzing all the
requirements, we have created our ERD and then converted the ERD to relational model and normalized
the tables. Using Microsoft SQL Server we have created the tables for our database and inserted some
sample values in the tables. Finally, we have executed sample queries on our database to check its
performance to retrieve useful information accurately and speedily.
REFERENCES
1 Organ Donation Management System - Chitra , Ramasamy (2007) - Melaka, Malaysia, UTeM.
2 Charity Management System - Sara Aljohani (2015)
3 DATABASE DESIGN, APPLICATION DEVELOPMENT, AND ADMINISTRATION (6thedition) –
Michael Mannino
4Blood Donation Management: Recent trends – Sunil K Joseph, Johnson Michael, Prem
Jose Vazhacharickal
5 SQL server tutorial: https://www.tutorialspoint.com/ms_sql_server/
6 Notes from Prof. Hakki C Cankaya, University of Texas at Dallas, Dallas, Texas
7Tool for ER diagram: Creately
https://creately.com/app/?tempID=hqdgwjki1&login_type=de
mo#
8 SQL Implementation Tool: Microsoft SQL Server 2017
P a g e | 28
P a g e | 29