0% found this document useful (0 votes)
6 views16 pages

DBMS Project Report Final

The document outlines a mini project report for a Hospital Management System developed using Flask and MySQL, aimed at efficiently managing hospital records. It details the system's functionalities, user roles (Admin and Receptionist), and the database structure including data types and relationships. The project emphasizes the need for a centralized, web-based solution to enhance accessibility and organization in managing patient and appointment records.

Uploaded by

adharshreddy1611
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views16 pages

DBMS Project Report Final

The document outlines a mini project report for a Hospital Management System developed using Flask and MySQL, aimed at efficiently managing hospital records. It details the system's functionalities, user roles (Admin and Receptionist), and the database structure including data types and relationships. The project emphasizes the need for a centralized, web-based solution to enhance accessibility and organization in managing patient and appointment records.

Uploaded by

adharshreddy1611
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Designing and Implementing a Relational DBMS on

“Hospital Management System”

Submitted to the

Savitribai Phule Pune University


In partial fulfillment for the award of the Degree of

Bachelor of Engineering
in

Information Technology
by

ADHARSH REDDY – S400220356 / 8208 IT-B


DHRUV SANGWAN - S400220364 / 8212 IT-B
HIMANSU - S400220368 / 8213 IT-B
ISHU- S400220369 / 8214 IT-B

(Exam Seat No. / Roll No. & Division)

Under the guidance of

Ms Jayshree Lavhare

Department of Information Technology


Army Institute of Technology,
Dighi Hills, Pune - 411 015.

2024-2025
CERTIFICATE

This is to certify that the mini project report


entitled “Hospital Management System” being
submitted by
ADHARSH REDDY – S400220356 / 8208 IT-B
DHRUV SANGWAN - S400220364 / 8212 IT-B
HIMANSU - S400220368 / 8213 IT-B
ISHU- S400220369 / 8214 IT-B
is a record of Bonafide work carried out by him/her under the supervision and guidance of Ms
Jayshree Lavhare in partial fulfillment of the requirement for SE (Information Technology
Engineering) – 2019 course of Savitribai Phule Pune University, Pune in the academic year
2020-2021.

Date:

Place: Pune

Guide Head of the Department

Principal

This Mini Project report has been examined by us as per the Savitribai Phule Pune
University, Pune requirements at Army Institute of Technology, Pune – 411015 on
...........

Internal Examiner External Examiner


ACKNOWLEDGEMENT

We would like to express our sincere gratitude to Ms. Jayshree Lavhare, our project guide, for her continuous
support, valuable guidance, and encouragement throughout the development of the Hospital Management System
project. Her expertise and insights were instrumental in shaping the project in the right direction.
We are also thankful to the Head of the Department and all the teaching and non-teaching staff members of the
Department of Information Technology, Army Institute of Technology, Pune, for providing the necessary resources
and academic environment that facilitated the completion of this project.
We would like to acknowledge the technical staff for their assistance with software and system requirements during
the development phase. We are also grateful to all the reviewers for their constructive feedback which helped
improve the quality of our work.
We extend our heartfelt thanks to our families and friends for their constant encouragement, motivation, and support
throughout this journey.
Finally, we would like to acknowledge all the resources, tutorials, and online materials that contributed to enhancing
our understanding and skills necessary for the successful execution of this project.

(Students Name & Signature)


CONTENTS

Sr.No TITLE Page no

1. Abstract 3

2. Introduction 3

3. Data Types 4

4. Data Requirements 4
Entities
Attributes
Relationships- Cardinality
5 Creating database using MySQL 4

6 Test Case Queries 16

7. Conclusion 16

8 References
1. ABSTRACT
This project presents a simple and user-friendly Hospital Management System developed using
Flask for the backend and MySQL for data storage. The main objective of this system is to
manage hospital records efficiently by allowing users to add, update, delete, and view patient and
appointment details. The application supports two roles: Admin and Receptionist.

Receptionists can view patient information and appointment schedules from anywhere within the
hospital system, making it convenient for hospital operations. On the other hand, only admins
have the privilege to add new doctor or patient records or remove existing ones from the system.
This system ensures secure data handling and a smooth user experience, making hospital
management easier, more organized, and accessible.
2. INTRODUCATION
E. F. Codd introduced the term in his seminal paper "A Relational Model of Data for Large
Shared Data Banks", published in 1970. In this paper and later papers he defined what he meant
by relational. One well-known definition of what constitutes a relational database system is
Codd's 12 rules. However, many of the early implementations of the relational model did not
conform to all of Codd's rules, so the term gradually came to describe a broader class of database
systems. At a minimum, these systems: • presented the data to the user as relations (a
presentation in tabular form, i.e. as a collection of tables with each table consisting of a set of
rows and columns, can satisfy this property) • provided relational operators to manipulate the
data in tabular form The first systems that were relatively faithful implementations of the
relational model were from the University of Michigan; Micro DBMS (1969) and from IBM UK
Scientific Centre at Peterlee; IS1 (1970–72) and its followon PRTV (1973–79). The first system
sold as an RDBMS was Multics Relational Data Store, first sold in 1978. Others have been
Berkeley Ingres QUEL and IBM BS12. The most popular definition of an RDBMS is a product
that presents a view of data as a collection of rows and columns, even if it is not based strictly
upon relational theory. By this definition, RDBMS products typically implement some but not all
of Codd's 12 rules.[1] A second, theorybased school of thought argues that if a database does not
implement all of Codd's rules (or the current understanding on the relational model, as expressed
by Christopher J Date, Hugh Darwen and others), it is not relational. This view, shared by many
theorists and other strict adherents to Codd's principles, would disqualify most DBMSs as not
relational. For clarification, they often refer to some RDBMSs as Truly-Relational Database
Management Systems (TRDBMS), naming others Pseudo-Relational Database Management
Systems (PRDBMS). As of now, all commercial relational DBMSes employ SQL as their query
language. Alternative query languages have been proposed and implemented, notably the pre-
1996 implementation of Berkeley Ingres QUEL. With standardization of the SQL, both
commercial and open source DBMSes have adopted some degree of standards compliance.
History of SQL (A Research Project Conducted by IBM)

With the rapid growth of digital platforms, managing data efficiently and providing easy access
to users have become essential components of any modern application. This project presents a
Hospital Management System developed using Flask (a lightweight Python web framework) and
MySQL as the backend database. The goal of this system is to provide a simple, intuitive, and
interactive interface for managing patients, doctors, and their related information such as
appointments and records.
This system is designed for two types of users: Admins and Receptionists. While receptionists
can view the available patient and appointment details from any location within the hospital
system, admins have the authority to add, update, and delete patient, doctor, and appointment
records. This separation of privileges ensures secure data handling and role-based access control.
The underlying database is built upon the relational model, a concept introduced by E. F. Codd in
1970, which organizes data into tables (relations) consisting of rows and columns. The use of
SQL (Structured Query Language), originally developed by IBM in the 1970s as part of the
System R project, provides a robust mechanism for querying and manipulating the data stored in
the system.
By leveraging modern web technologies and proven database principles, the Hospital
Management System provides a practical solution for organizing and maintaining hospital
information efficiently, making it a useful tool for hospital administration and healthcare
management.

2.1 Problem Statement.

In many small-scale hospitals, clinics, and healthcare centers, managing patient and appointment
records manually or through basic spreadsheets leads to inefficiencies, errors, and limited
accessibility. There is a need for a centralized, user-friendly, and web-based system that allows
easy addition, modification, and deletion of patient, doctor, and appointment details.

This project aims to develop a Hospital Management System using Flask and MySQL, which
will provide:
• An intuitive interface for receptionists to view patient and appointment information from any
location within the hospital system.
• A secure backend for admins to handle hospital records through add, update, and
delete operations.
3. Efficient storage and retrieval of healthcare data using relational database
concepts.

3.1 Motivation

In today’s digital age, maintaining organized and accessible information is crucial, especially for
critical systems like managing hospital records. Traditional methods such as physical registers or
spreadsheets are prone to errors, lack accessibility, and do not support real-time updates. This
inspired the development of a Hospital Management System that is not only efficient but also
user-friendly and accessible within the hospital network.
The motivation behind this project lies in building a lightweight web-based solution that
leverages modern technologies like Flask and MySQL to provide smooth interaction between
the hospital staff and the system. With the increasing demand for digital healthcare solutions
and efficient record management, it has become essential to have a system where receptionists
can manage appointments easily, while authorized personnel like admins can control and
update patient and doctor records securely.
This project also serves as a learning platform to gain hands-on experience with full-stack
development, backend database integration, and role-based access management.

3.2 . Objectives

The primary objectives of the Hospital Management System project are:


1. To develop a web-based application using Flask for hospital records
effectively.
2. To provide a user-friendly interface for customers to view the list of patients, doctors,
and appointments.
3. To implement role-based access, where only the manager can add, update, or delete
patient, doctor, and appointment entries.
4. To use a relational database (MySQL) for storing hospital details in a structured
and secure manner.
5. To allow real-time interaction with the database, ensuring data consistency and
quick retrieval.
6. To provide CRUD (Create, Read, Update, Delete) operations for hospital
data management.
7. To gain practical knowledge of backend development, SQL integration, and full-stack
project deployment.
4. Data Types
In this project, various data types are used to represent different kinds of information in the
database. The main data types used are:

Data Type Description

INT Used for numeric values like patient IDs, doctor IDs, and appointment IDs.

VARCHAR(n) Used to store variable-length text.

TEXT Used to store long-form text like patient addresses or detailed medical
histories.

DECIMAL(a,b) Used to store fees or other numeric values with precision (e.g., DECIMAL(10,2)
stores numbers up to 99999999.99).

DATETIME Used to store date and time values for patient registration and appointment
scheduling.

ENUM Used to restrict the values to a specific set (e.g., user roles like 'admin' or 'receptionist',
gender as 'male', 'female', or 'other', appointment status like 'scheduled', 'completed', or 'cancelled').
5. Data Requirments
Entities
1. User
2. Patient
3. Doctor
4. Appointment
Attributes
1. User
• user_id: Unique ID for each user (INT).
• username: Name used for login (VARCHAR).
• password: User password (VARCHAR).
• role: Defines if the user is a doctor, administrator, or patient (ENUM).
• date_created: Date the account was created (DATETIME).
2. Patient
• patient_id (INT): Unique ID for each patient.
• first_name (VARCHAR): Patient's first name.
• last_name (VARCHAR): Patient's last name.
• dob (DATE): Date of birth
• gender (ENUM): Gender of the patient.
• contact_number (VARCHAR): Patient’s contact number.
• address (VARCHAR): Address of the patient.
3. Appointment
 appointment_id (INT): Unique ID for each appointment.
 patient_id (INT): Reference to the patient (foreign key).
 doctor_id (INT): Reference to the doctor (foreign key).
 appointment_date (DATETIME): Date and time of the appointment.
 status (ENUM): Status of the appointment (e.g., scheduled, completed, canceled).
4. Doctor
• doctor_id (INT): Unique ID for each doctor.
• first_name (VARCHAR): Doctor's first name.
• last_name (VARCHAR): Doctor's last name.
• specialization (VARCHAR): Doctor's area of expertise.
• contact_number (VARCHAR): Contact number of the doctor.
• email (VARCHAR): Email address of the doctor.
• availability (VARCHAR): Availability hours or shift details.

Relationships and Cardinality Relationship Cardinality


User — Appointment One-to-Many (1:N)
Patient — Appointment One-to-Many (1:N)
Doctor — Appointment One-to-Many (1:N)
Doctor — User One-to-One (1:1)
6. CREATING DATABASE USING MYSQL
CREATE DATABASE IF NOT EXISTS hospital_management;

USE hospital_management;
CREATE TABLE IF NOT EXISTS Users (
user_id INT PRIMARY KEY AUTO_INCREMENT,
username VARCHAR(100) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
role ENUM('doctor', 'nurse', 'admin', 'patient') NOT NULL,
date_created DATETIME DEFAULT CURRENT_TIMESTAMP
);
Explanation:
 Staff or patients can log in.
 role can be 'doctor', 'nurse', 'admin', or 'patient'.

CREATE TABLE IF NOT EXISTS Patients (


patient_id INT PRIMARY KEY AUTO_INCREMENT,
first_name VARCHAR(100) NOT NULL,
last_name VARCHAR(100) NOT NULL,
dob DATE,
gender ENUM('male', 'female', 'other'),
contact_number VARCHAR(20),
address VARCHAR(255),
email VARCHAR(100),
date_registered DATETIME DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS Doctors (


doctor_id INT PRIMARY KEY AUTO_INCREMENT,
first_name VARCHAR(100) NOT NULL,
last_name VARCHAR(100) NOT NULL,
specialization VARCHAR(100),
contact_number VARCHAR(20),
email VARCHAR(100),
availability VARCHAR(100),
date_joined DATETIME DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS Appointments (


appointment_id INT PRIMARY KEY AUTO_INCREMENT,
patient_id INT,
doctor_id INT,
appointment_date DATETIME NOT NULL,
status ENUM('scheduled', 'completed', 'cancelled') DEFAULT 'scheduled',
FOREIGN KEY (patient_id) REFERENCES Patients(patient_id) ON DELETE CASCADE,
FOREIGN KEY (doctor_id) REFERENCES Doctors(doctor_id) ON DELETE CASCADE
);

SNAPSHOTS
7. Test Queries(Minimum 25 Queries)
-- Insert Patients
INSERT INTO Patients (first_name, last_name, dob, gender, contact_number, address, email)
VALUES ('John', 'Doe', '1990-05-12', 'male', '9876543210', '123 Main St', '[email protected]');

INSERT INTO Patients (first_name, last_name, dob, gender, contact_number, address, email)
VALUES ('Jane', 'Smith', '1985-09-23', 'female', '9876543211', '456 Maple Ave',
'[email protected]');

-- Insert Doctors
INSERT INTO Doctors (first_name, last_name, specialization, contact_number, email, availability)
VALUES ('Dr. Alex', 'Brown', 'Cardiologist', '9876543220', '[email protected]', 'Mon-Fri 10am-
4pm');

INSERT INTO Doctors (first_name, last_name, specialization, contact_number, email, availability)


VALUES ('Dr. Emily', 'Green', 'Dermatologist', '9876543221', '[email protected]', 'Tue-Thu
12pm-5pm');

-- Insert Appointments
INSERT INTO Appointments (patient_id, doctor_id, appointment_date)
VALUES (1, 1, '2025-05-05 11:00:00');

INSERT INTO Appointments (patient_id, doctor_id, appointment_date)


VALUES (2, 2, '2025-05-06 13:30:00');

-- Insert Medical Records


INSERT INTO MedicalRecords (patient_id, doctor_id, diagnosis, treatment)
VALUES (1, 1, 'High Blood Pressure', 'Prescribed lifestyle changes and medication.');

INSERT INTO MedicalRecords (patient_id, doctor_id, diagnosis, treatment)


VALUES (2, 2, 'Skin Allergy', 'Prescribed antihistamine tablets.');

-- Insert Prescriptions
INSERT INTO Prescriptions (patient_id, doctor_id, medication_details)
VALUES (1, 1, 'Tablet A - 1 daily after meals for 30 days.');

INSERT INTO Prescriptions (patient_id, doctor_id, medication_details)


VALUES (2, 2, 'Ointment B - Apply twice daily.');

-- View all Patients


SELECT * FROM Patients;

-- View all Doctors


SELECT * FROM Doctors;

-- View all Appointments


SELECT * FROM Appointments;
-- Update Patient's Contact Number
UPDATE Patients
SET contact_number = '9876543299'
WHERE patient_id = 1;

-- Update Doctor's Availability


UPDATE Doctors
SET availability = 'Mon-Fri 9am-3pm'
WHERE doctor_id = 1;

-- Update Appointment Status


UPDATE Appointments
SET status = 'completed'
WHERE appointment_id = 1;

-- Delete a Patient
DELETE FROM Patients
WHERE patient_id = 2;

-- Delete a Doctor
DELETE FROM Doctors
WHERE doctor_id = 2;

-- Search Patients by Name


SELECT * FROM Patients
WHERE first_name LIKE '%John%';

-- Search Doctors by Specialization


SELECT * FROM Doctors
WHERE specialization LIKE '%Cardiologist%';

-- Find Appointments after a Specific Date


SELECT * FROM Appointments
WHERE appointment_date > '2025-05-01';

-- Find Completed Appointments


SELECT * FROM Appointments
WHERE status = 'completed';

-- Find Prescriptions for a Patient


SELECT * FROM Prescriptions
WHERE patient_id = 1;

-- Find Medical Records by Doctor


SELECT * FROM MedicalRecords
WHERE doctor_id = 1;

-- Count Total Number of Patients


SELECT COUNT(*) AS total_patients
FROM Patients;

8. Conclusion
The Hospital Management System developed using Flask and MySQL successfully
achieves its goal of providing an efficient, user-friendly, and role-based web application for
managing hospital operations.
The system allows patients to conveniently book appointments and view their medical
records, while enabling doctors and administrators to perform crucial operations such as
managing patient information, scheduling appointments, and maintaining medical records
and prescriptions.

This project not only demonstrates the practical application of relational database
concepts and web development technologies but also enhances the understanding of how to
integrate frontend and backend components effectively.
The implementation of CRUD functionalities, secure data handling, and role-based access
control ensures that the system is reliable, scalable, and ready for real-world hospital
management needs.

9. References.
Code with harry https://youtu.be/oA8brF3w5XQ?si=zBIP5byztlcv1fiA

You might also like