Case study · Database design · MySQL
Blood Bank Management System
A relational database design for managing blood donors, receivers, hospitals and blood banks in MySQL, documented from the ER diagram to SQL queries.
- Type
- Database design · MySQL
- Built by
- Nishan Bharati
- Started
- July 2025
- Status
- Design report (PDF) on GitHub. The SQL is in the report, not in separate files.
- Stack
- MySQL
- SQL
- ER modelling
What it does
A database project that models how a blood bank tracks the people who donate and receive blood, the blood units collected, donation centres, hospitals and the staff who manage them. The report walks through the design in three phases: modelling, table creation and querying.
Features
- An entity-relationship diagram reduced to relational tables
- 13 tables, including Person, Donor, Receiver, Blood, Blood_Bank, Donation_Center, Hospital and the Donate, Collects and Visit relationship tables
- Primary and foreign keys linking donors, blood units, banks and donation centres
- Sample data inserted into every table
- Queries using aggregate functions, GROUP BY, inner, right and cross joins, and a view
How it works
Phase I: modelling
The ER diagram identifies the entities (people, donors, receivers, blood units, banks, centres, hospitals, managers and receptionists) and their relationships, then reduces them to tables.
Phase II: DDL
CREATE TABLE statements define each table with its keys, followed by examples of DROP, RENAME and TRUNCATE.
Phase III: DML and queries
INSERT statements load sample data. The queries then use AVG, COUNT, MAX, MIN and SUM, group blood units by blood group, join donors to people and blood units, and define a DONOR_COUNT view.
What I would improve next
- Commit the SQL as .sql files next to the report, so the schema can be run directly.
- Connect the database to a small Node.js and Express.js API with an admin interface.
Built by Nishan Bharati, MERN Stack Developer and co-founder of Navya EdTech. Want something similar built?
Get in touch