Blood Bank Management System (Python&MySQL)
Blood Bank Management System (Python&MySQL)
NAME
ROLL NUMBER
CLASS & SEC
SUBJECT
TOPIC
SUNSHINE CHENNAI SENIOR SECONDARY SCHOOL
(Affiliated to Central Board of Secondary Education, New Delhi)
86/2, AGS Colony, Puzhuthivakkam, Madipakkam, Chennai-91
BONAFIDE CERTIFICATE
SIGNATURE OF
1) Internal Examiner
2) External Examiner
ACKNOWLEDGEMENT
I would like to take this opportunity to extend my sincere gratitude and appreciation
to my computer Science teacher for providing support throughout the process of
completing my computer project for school. I am also thankful to my principal for
allowing me the opportunity to explore and work on this project.
RAGHAV KARTHIK
INDEX
1. Introduction to Python:-----------------------------------------------------------------------------------------------------------5
1.1 Pros and Cons of Python:-------------------------------------------------------------------------------5
1.2 Working in Python:---------------------------------------------------------------------------------------5
2. Advantages/Benefits of Python:- ............................................................................................................. 6
3. Introduction to MySQL: - ......................................................................................................................... 7
3.1 What is MySQL?--------------------------------------------------------------------------------------------7
3.2 What is SQL?------------------------------------------------------------------------------------------------ 7
3.2.1 Summary of MYSQL Commands:----------------------------------------------------------------7
3.2.2 Connect MySQL database using Python-------------------------------------------------------8
4. System Requirements: -........................................................................................................................... 9
4.1 Hardware Requirements----------------------------------------------------------------------------------9
4.2 Software Requirements-----------------------------------------------------------------------------------9
5. Objective: -............................................................................................................................................ 10
6. System Design: - ..................................................................................................................................... 11
7. Program Code:- ...................................................................................................................................... 12
8. Output Screen:-...................................................................................................................................... 13
9. Conclusion:- ........................................................................................................................................... 16
10. Bibliography:- ....................................................................................................................................... 16
1. Introduction to Python:-
Python is a programming language that lets you work quickly and integrate systems more
efficiently.
Cons:-
Not the Fastest Language
Not Strong on Type-binding
Not Easily Convertible
Poor multithreading
Poor Memory Efficiency
Weak in Mobile Computing
The diverse application of the Python language is a result of the combination of features that
give this language an edge over others. Some of the benefits of programming in Python include:
-- Database-Level
DROP DATABASE databaseName -- Delete the database (irrecoverable!)
DROP DATABASE IF EXISTS databaseName -- Delete if it exists
CREATE DATABASE databaseName -- Create a new database
CREATE DATABASE IF NOT EXISTS databaseName -- Create only if it does not exists
SHOW DATABASES -- Show all the databases in this server
USE databaseName -- Set the default (current) database
SELECT DATABASE() -- Show the default database
SHOW CREATE DATABASE databaseName -- Show the CREATE DATABASE statement
-- Table-Level
DROP TABLE [IF EXISTS] tableName, ...
CREATE TABLE [IF NOT EXISTS] tableName (
columnName columnType columnAttribute, ...
PRIMARY KEY(columnName),
FOREIGN KEY (columnNmae) REFERENCES tableName (columnNmae)
)
SHOW TABLES -- Show all the tables in the default database
DESCRIBE|DESC tableName -- Describe the details for a table
ALTER TABLE tableName ... -- Modify a table, e.g., ADD COLUMN and DROP COLUMN
ALTER TABLE tableName ADD columnDefinition
ALTER TABLE tableName DROP columnName
ALTER TABLE tableName ADD FOREIGN KEY (columnNmae) REFERENCES tableName (columnNmae)
ALTER TABLE tableName DROP FOREIGN KEY constraintName
SHOW CREATE TABLE tableName -- Show the CREATE TABLE statement for this tableName
-- Row-Level
INSERT INTO tableName
VALUES (column1Value, column2Value,...) -- Insert on all Columns
INSERT INTO tableName
VALUES (column1Value, column2Value,...), ... -- Insert multiple rows
INSERT INTO tableName (column1Name, ..., columnNName)
VALUES (column1Value, ..., columnNValue) -- Insert on selected Columns
DELETE FROM tableName WHERE criteria
UPDATE tableName SET columnName = expr, ... WHERE criteria
SELECT * | column1Name AS alias1, ..., columnNName AS aliasN
FROM tableName
WHERE criteria
GROUP BY columnName
ORDER BY columnName ASC|DESC, ...
HAVING groupConstraints
LIMIT count | offset count
This section describes the recommended hardware requirements for the Enterprise Service
Manager.
8 GB RAM or more
Make sure you have a recent pip version installed on your system. If your system already
has pip installed, you might need to update it.
The objective is to develop the Blood Bank Management System project. The aim is to
provide blood donation service to the city recently. Blood Bank Management System (BBMS) is a
system that is designed to store, process, retrieve and analyse information concerned with the
administrative and inventory management within a blood bank. This project aims at maintaining all
the information pertaining to blood donors, different blood groups available in each blood bank and
help them manage in a better way. Aim is to provide transparency in this field, make the process of
obtaining blood from a blood bank hassle free and corruption free and make the system of blood
bank management effective.
Needs of Blood Bank Management System
Bank blood donation system is planned to collect blood from many donators and distribute that
blood to needy people who require blood. To do all this, we require high quality software to
manage those jobs.
To fulfil these need, blood bank management system project contain modules which are include
the detail of following areas:-
• Blood Donor
• Blood Recipient
• Blood collection
• Camp
• Stock details
The main objective of this application is to automate the complete operations of the blood
bank. They need to maintain hundreds of thousands of records. Also searching should be
very faster, so they can find required details instantly.
This system makes conveniently available good quality, safe blood and other blood
components, which can be provided in a sound, ethical and acceptable manner, consistent
with the long-term well-being of the community. It actively encourages voluntary blood
donation, motivate and maintain a well-indexed record of blood donors and educate the
community on the benefits of blood donation. This will also serve as the store in reducing
unnecessary utilization of blood and help the blood bank work more efficiently towards self-
sufficiency in blood.
The system will provide the user the option to look at the details of the existing Donor List,
Blood Group and to add a new Donor. It also allows the user to modify the record. The
administrator can alter all the system data.
This is the overall system architecture of Blood Bank Management System. We use Python and
MySQL Db for this project.
We would insert, update, delete and also retrieve record from data base through Python script
from MySQL Db. We would also create database, create tables, and insert bulk of records through
MySQL sql scripts itself in the initial stage. Later, we can maintain the Db and insert/update or
retrieve records from Python program itself.
1)Blood_Bank
2)Patient
3)Donor
4)Stock
Patient and Donor tables have its own primary key(unique identifier) in them. And Blood_Bank has
primary key and foreign keys(reference keys) to Patient and Donor tables.
Whenever a patient or donor record is inserted, we would do the insert into Blood_Bank table. And
the stock table would be updated on a regular basis based on the utilization of blood for the
patients and the quantity of blood added by the donor.
7. Program Code:-
This is the Python program developed to insert, update, delete and retrieve records from
Blood_Bank Db tables.
8. Output Screen:-
SELECT *
FROM
blood_bank.blood_bank
where
blood_bank_id=308;
Some of the reporting queries on blood bank data, that were run in MySQL Db:-
SELECT Patient_Name,Blood_Group,Disease
FROM Patient
WHERE Patient_ID = 101;
SELECT Donor_Name,Donor_Addresss,Donor_Contact,Medical_Report
FROM Donor
WHERE Medical_Report = 'Satisfactory';
SELECT Patient_Name,Blood_Group,Blood_Bank_Name,blood_bank.patient_id,patient.patient_id
FROM Patient, Blood_Bank
WHERE blood_bank.patient_id = patient.patient_id;
SELECT Donor_Name,Medical_Report,Donor_Addresss,donor.donor_id,Blood_Bank_Name
FROM Donor,Blood_Bank
WHERE blood_bank.donor_id = donor.donor_id;
9. Conclusion:-
With the Python code and MySQL, we are able to build effective Blood Bank Management System,
which would in turn help in effectively utilizing the donor’s blood for the needy patients. This would
serve as the great project for our society.
We would also be able to do analysis of the patient, donor, and blood bank data by running the
reporting queries in MySQL Db. This analysis work would be useful in collecting the necessary
quantity of blood group and also would ensure the fitness of the donor providing blood, thereby
ensuring patient is receiving the right blood group with all the proper health parameters.
10. Bibliography:-
https://www.python.org/
https://dev.mysql.com/doc/
https://www.javatpoint.com/mysql-tutorial