Blood Bank Management System
1. Project Description
This project is about designing a Blood Bank Management System. The system manages
donor information, blood stock, and transaction records. It facilitates the organization in
keeping track of available blood, donors, and patients. The database contains detailed
information such as donor name, contact, blood type, and availability.
2. ER Diagram
The ER Diagram would depict the entities Donor, BloodStock, Transaction, and Patient, with
relationships such as 'Donates', 'Receives', and 'Maintains'. (Please insert ER diagram here.)
3. Relational Database
Here is a representation of the relational database structure for the Blood Bank
Management System:
Table Name Attributes
Donor DonorID (PK), Name, Age, Gender,
BloodType, ContactNumber
BloodStock BloodID (PK), BloodType, Quantity,
ExpiryDate
Patient PatientID (PK), Name, Age, Gender,
BloodTypeRequired, Contact
Transaction TransactionID (PK), DonorID (FK),
PatientID (FK), BloodID (FK),
TransactionDate
4. Normalization on One Table
Here, we normalize the Donor table. Initially, the Donor table contains redundant
information like address and contact number. After normalization, the ContactDetails are
separated from the Donor table to avoid redundancy.
Before normalization:
DonorID Name Age Gender BloodTyp ContactNu Address
e mber
D001 John Doe 28 Male O+ 98765432 123 Elm
10 Street
D002 Jane Smith 34 Female A+ 87654321 456 Oak
09 Avenue
After normalization:
Donor Table:
DonorID Name Age Gender BloodType
D001 John Doe 28 Male O+
D002 Jane Smith 34 Female A+
ContactDetails Table:
ContactID DonorID ContactNumber Address
C001 D001 9876543210 123 Elm Street
C002 D002 8765432109 456 Oak Avenue
5. SQL Queries with Output
Here are some SQL queries that can be performed on the Donor table:
1. Query: Find all donors with blood type O+.
SQL: SELECT * FROM Donor WHERE BloodType = 'O+';
Output:
DonorID Name Age Gender BloodType
D001 John Doe 28 Male O+
2. Query: Count the total number of donors by blood type.
SQL: SELECT BloodType, COUNT(*) AS TotalDonors FROM Donor GROUP BY BloodType;
Output:
BloodType TotalDonors
O+ 1
A+ 1