CERTIFICATE
This is to certify that PRITAM SINGH HADA and AYAN PATHAN, students of Class
XII, have successfully completed the Computer Science Project titled “Hospital
Management System” during the academic session 20____ – 20____, as prescribed
by the Central Board of Secondary Education (CBSE).
This project is an original work carried out by the students under my supervision.
The project involves the practical application of Python programming and MySQL
database management, including Python–MySQL connectivity. The work submitted
by the students has been found to be satisfactory and fulfills the requirements of the
CBSE Class XII Computer Science practical examination.
I wish them success in their future academic and professional endeavors.
Teacher’s Name: SONAM SAXENA MA’AM.
Subject: Computer Science
Signature of Teacher: _____________________
Signature of External Examiner: ______________
Principal’s Name: ALEKHA KAPLASH MA’AM
Signature of Principal: ____________________
School Seal
ACKNOWLEDGEMENT
We would like to express our sincere gratitude to our Computer Science
teacher for their valuable guidance, continuous encouragement, and support
throughout the development of this project titled “Hospital Management
System.” Their supervision and timely suggestions helped us in completing
this project successfully.
We are thankful to the Principal and the school management for providing the
necessary facilities and resources required for the completion of this project.
We would also like to acknowledge the support and cooperation of our parents
and friends, whose motivation and encouragement helped us throughout the
course of this project.
This project has given us an opportunity to practically implement the concepts
of Python programming and MySQL database management learned during the
academic session. It has helped us understand the importance of database-
driven applications and enhanced our problem-solving and programming
skills.
PRITAM SINGH HADA
AYAN PATHAN
______________________________________________________________________________
Class XII
Subject: Computer Science
______________________________________________________________________________
INDEX
1️⃣ Certificate
2️⃣ Acknowledgement
3️⃣ Index / Table of Contents
4️⃣ Introduction
5️⃣ Objectives of the Project
6️⃣ PROBLEM DEFINITION
🔹 Hospital Management Example
7️⃣ Scope of the Project
8️⃣ System Requirements
9️⃣ Tools & Technologies Used
🔟 Database Design
1️⃣1️️⃣ Implementation
🔹 MySQL Code
🔹 Python Program
1️⃣2️️⃣ Output Screens / Testing
1️⃣3️️⃣ Advantages and Limitations
1️⃣4️️⃣ Future Scope
1️⃣5️️⃣ Conclusion
1️⃣6️️⃣ Bibliography
INTRODUCTION
In the present digital era, the use of computers has become essential in almost every
field, including the healthcare sector. Hospitals handle a large amount of data
related to patients, doctors, staff, appointments, and medical records on a daily
basis. Managing all this information manually is time-consuming and may lead to
errors. Therefore, there is a need for an efficient computerized system to manage
hospital operations smoothly and accurately.
The Hospital Management System is a computerized application developed to
manage and maintain hospital records in a systematic manner. This system helps in
storing, retrieving, updating, and managing information related to patients, doctors,
treatment details, and billing records. It reduces paperwork and improves the
efficiency and accuracy of hospital administration.
This project has been developed as part of the Central Board of Secondary
Education (CBSE) Class XII Computer Science curriculum. The main objective of
this project is to apply the concepts of Python programming and MySQL database
management in a real-life scenario. In this project, Python is used as the front-end
programming language to create a menu-driven program, while MySQL is used as
the back-end database to store hospital data securely.
The project also includes the study and implementation of Python–MySQL
connectivity using MySQL Connector. Various database operations such as
insertion, deletion, updating, and retrieval of data are performed using SQL
queries. This ensures proper interaction between the Python program and the
MySQL database.
The Hospital Management System project provides practical exposure to database
handling and programming concepts. It helps students understand how computer
applications are used to solve real-world problems in the healthcare sector. The
system is user-friendly, reliable, and suitable for small-scale hospital management,
making it an ideal project for academic learning.
OBJECTIVES OF THE PROJECT
The main objective of developing the Hospital Management System is to create a
computerized system that efficiently manages hospital-related information and
operations. This project aims to reduce manual work, minimize errors, and improve
the overall efficiency of hospital management using computer technology.
The specific objectives of this project are as follows:
To develop a user-friendly system for maintaining patient records, doctor
details, and hospital information.
To understand and implement Python programming concepts such as
functions, loops, conditional statements, and menu-driven programs.
To design and manage a MySQL database for storing hospital data in an
organized and structured manner.
To perform database operations such as insertion, deletion, updating, and
retrieval of records using SQL queries.
To establish effective Python–MySQL connectivity using MySQL Connector.
To reduce paperwork and ensure secure storage of hospital data.
To provide quick and accurate access to hospital information when required.
To understand the practical application of database management systems in
real-life hospital environments.
To enhance problem-solving skills by developing a real-world application.
This project helps in gaining practical knowledge of programming and database
management while demonstrating how computer systems can be effectively used in
the healthcare sector.
PROBLEM DEFINITION
Hospitals handle a large amount of information related to patients, doctors, staff,
medical records, and billing on a daily basis. In many hospitals, especially small and
medium-scale institutions, these records are maintained manually using registers
and files. Manual record keeping creates several difficulties in managing hospital
operations efficiently
.
One of the major problems of the manual hospital system is time consumption.
Searching for patient records, updating details, and preparing reports require a lot
of time and effort. This often leads to delays in providing services and affects the
overall efficiency of the hospital.
Another major issue is data redundancy and inconsistency. In manual systems, the
same information is recorded multiple times in different registers, which increases
the chances of errors and duplication of data. This makes record maintenance
difficult and unreliable.
The lack of data security is also a serious concern in manual systems. Physical
records can be easily damaged, lost, or accessed by unauthorized persons. There is
no proper mechanism to protect sensitive patient information.
Moreover, retrieving and updating records in a manual system is difficult and
inefficient. As the number of patients increases, managing and organizing records
becomes complex and unmanageable.
To overcome these problems, there is a need for a computerized Hospital
Management System. A computerized system using Python and MySQL ensures
quick data processing, secure storage, reduced redundancy, and easy retrieval of
records. It improves accuracy, saves time, and enhances the overall efficiency of
hospital management.
SCOPE OF THE PROJECT
The scope of the Hospital Management System project defines the functional
boundaries of the system and explains the areas covered by the project. This project
has been designed to computerize basic hospital operations and improve the
efficiency of record management. It aims to replace the traditional manual system
with a reliable and user-friendly computerized solution.
This project is intended for use in a small-scale hospital or clinic where basic
hospital data needs to be maintained efficiently. The system focuses on maintaining
accurate records related to patients, doctors, and billing information. It helps in
organizing data systematically and allows quick access to information whenever
required.
Patient Management Module
The patient management module is responsible for maintaining patient-related
information such as patient ID, name, age, gender, contact details, disease
description, and admission details. The system allows the user to add new patient
records, update existing records, delete incorrect entries, and retrieve patient
information when needed.
This module helps reduce manual errors and ensures that patient records are stored
securely in the MySQL database. It also enables faster retrieval of patient details,
which is essential for effective hospital management.
Doctor Management Module
The doctor management module handles information related to doctors working in
the hospital. It includes details such as doctor ID, name, specialization, contact
number, and availability status. This module helps in maintaining an organized
record of doctors and their respective fields.
By using this module, hospital staff can easily access doctor details and manage
doctor records efficiently. This improves coordination within the hospital and
reduces dependency on manual record keeping.
Billing Management Module
The billing management module is designed to maintain patient billing records. It
includes details such as bill number, patient ID, treatment charges, consultation fees,
and total amount. This module ensures accurate calculation and maintenance of
billing information.
The computerized billing system reduces calculation errors and saves time
compared to manual billing processes. It also allows easy retrieval of billing records
for future reference.
Database and Connectivity Scope
The project includes the use of MySQL as the back-end database to store hospital
data in a structured manner. Database operations such as insertion, deletion,
updating, and retrieval of records are performed using SQL queries.
The project also demonstrates Python–MySQL connectivity using MySQL
Connector. This enables smooth communication between the Python program and
the database, ensuring efficient data handling.
Limitations of the Project Scope
Despite its usefulness, the scope of this project is limited. The system does not
include advanced features such as online appointment scheduling, pharmacy
management, laboratory systems, insurance processing, or emergency services
management.
The project does not support multi-user access, cloud storage, or real-time data
processing. It is not intended for large hospitals or real-world clinical use. The
project is developed strictly for educational and academic purposes as per CBSE
guidelines.
Educational Relevance
This project is designed to help students apply the concepts of Python
programming, MySQL database design, and database connectivity learned in
the CBSE Class 12 Computer Science syllabus. It serves as a practical learning
model to understand how computerized systems are used in the healthcare sector.
______________________________________________________________________________
SYSTEM REQUIREMENTS
The successful development and execution of the Hospital Management System
require certain hardware and software components. These system requirements
ensure smooth functioning of the application and proper interaction between the
Python program and the MySQL database. The system requirements for this project
are divided into hardware requirements and software requirements.
Hardware Requirements
A standard computer system is required to develop and run the Hospital
Management System. The computer should have a minimum of 4 GB RAM, which
is sufficient to execute the Python program and manage the MySQL database
efficiently. Adequate memory ensures smooth performance while performing
database operations such as inserting, updating, deleting, and retrieving records.
Input devices such as a keyboard and mouse are required for entering data and
interacting with the system. A printer is optional but useful for printing reports,
patient records, and billing details if required. The hardware configuration
mentioned above is commonly available and suitable for small-scale applications
and educational purposes.
Software Requirements
The project requires the Windows Operating System, which provides a stable
environment for installing and running Python and MySQL. Python 3.x is used as the
front-end programming language to develop the menu-driven Hospital Management
System. Python is chosen due to its simplicity, readability, and support for database
connectivity.
The back-end of the project uses MySQL Server, which is responsible for storing
and managing hospital data in a structured format. MySQL supports efficient data
handling and ensures data integrity.
To enable communication between Python and MySQL, MySQL Connector is used.
It allows the Python program to connect to the MySQL database and perform various
database operations seamlessly.
______________________________________________________________________________
TOOLS & TECHNOLOGIES USED
The development of the Hospital Management System project involves the use of
various tools and technologies that help in designing, implementing, and managing
the application efficiently. These tools play an important role in ensuring proper
interaction between the user and the database system.
Python (Front-End):-
Python is used as the front-end programming language in this project. It is
responsible for creating a menu-driven interface through which the user interacts
with the system. Python handles user input, processes data, and displays
appropriate outputs.
Python is easy to understand, flexible, and well-suited for beginners. It supports
various programming concepts such as functions, loops, conditional statements, and
exception handling, which are effectively used in this project. Python also provides
strong support for database connectivity, making it an ideal choice for developing
this application.
MySQL (Back-End):-
MySQL is used as the back-end database management system in this project. It is
responsible for storing hospital-related data such as patient records, doctor details,
and billing information in a structured manner.
MySQL ensures data consistency, integrity, and security. It allows the use of SQL
queries to perform operations such as insertion, deletion, updating, and retrieval of
records. The use of MySQL helps in efficient management of large amounts of data
and reduces redundancy.
MySQL Connector:-
MySQL Connector is used to establish a connection between the Python program
and the MySQL database. It acts as a bridge that allows Python to execute SQL
queries directly on the MySQL database.
Through MySQL Connector, the project performs database operations seamlessly
and ensures smooth communication between the front-end and back-end. This helps
in real-time interaction with the database and enhances the overall functionality of
the system.
DATABASE DESIGN
Database design is an important part of the Hospital Management System as it
defines how data is stored, organized, and managed. A well-structured
database helps in reducing data redundancy and ensures efficient data
retrieval. In this project, MySQL is used as the database management system
to store hospital-related information.
The database design of this project includes an Entity Relationship (ER)
Diagram and the table structure for storing data related to hospital operations.
______________________________________________________________________________
ER DIAGRAM DESCRIPTION
An Entity Relationship (ER) Diagram represents the logical structure of the
database by showing the relationship between different entities. The main
entities involved in the Hospital Management System are Patient, Doctor,
Appointment, and Billing.
Patient Entity:-
The Patient entity stores information related to patients visiting the hospital. It
includes attributes such as patient ID, name, age, gender, contact number,
address, and disease description. Each patient is uniquely identified using a
Patient ID, which acts as the primary key.
Doctor Entity:-
The Doctor entity stores information about doctors working in the hospital.
Attributes include doctor ID, doctor name, specialization, contact number, and
availability. The Doctor ID is the primary key used to uniquely identify each
doctor.
______________________________________________________________________________
Appointment Entity:-
The Appointment entity manages the details of appointments between patients
and doctors. It includes attributes such as appointment ID, patient ID, doctor
ID, appointment date, and appointment time. The Appointment entity
establishes a relationship between the Patient and Doctor entities using foreign
keys.
_____________________________________________________________________________
Billing Entity:-
The Billing entity stores information related to patient billing. Attributes
include bill ID, patient ID, consultation fees, treatment charges, and total
amount. The Billing entity is associated with the Patient entity and helps in
maintaining accurate billing records.
TABLE STRUCTURE
The following tables are created in the MySQL database to store hospital data:
Patient Table:-
Field Name Data Type Description
patient_id INT (Primary Key) Unique identification number of the patient
name VARCHAR(50) Name of the patient
age INT Age of the patient
gender VARCHAR(10) Gender of the patient
contact VARCHAR(15) Contact number
disease VARCHAR(100) Disease or problem
address VARCHAR(100) Address of the patient
Doctor Table:-
Field Name Data Type Description
doctor_id INT (Primary Key) Unique doctor ID
name VARCHAR(50) Name of the doctor
specialization VARCHAR(50) Doctor’s specialization
contact VARCHAR(15) Contact number
availability VARCHAR(20) Availability status
Appointment Table:-
Field Name Data Type Description
appointment_id INT (Primary Key) Appointment ID
patient_id INT (Foreign Key) References Patient table
doctor_id INT (Foreign Key) References Doctor table
date DATE Appointment date
time TIME Appointment time
Login Table:-
Field Name Data Type Description
username VARCHAR(30) (Primary Key) Login username
password VARCHAR(30) Login password
role VARCHAR(20) User role (Admin/Staff)
IMPLEMENTATION
The implementation phase of the Hospital Management System involves the actual
development of the project using Python as the front-end and MySQL as the back-
end. The system is designed to perform operations such as adding, updating,
deleting, and retrieving records from the database. A menu-driven Python
program is used to interact with the user, while the MySQL database stores and
manages the data efficiently.
______________________________________________________________________________
MySQL Code:-
The MySQL database is designed to store hospital-related information. The following
SQL commands are used for implementing the database tables and operations:
INSERT QUERIES :-
UPDATE QUERIES:-
DELETE QUERIES:-
SELECT QUERIES:-
______________________________________________________________________________
Python Program:-
The Python program acts as the front-end of the system. It is a menu-driven
program that allows users to perform CRUD operations (Create, Read, Update,
Delete) on the hospital database. Python interacts with the MySQL database using
MySQL Connector.
______________________________________________________________________________
Key Features:-
1. Menu-Driven Program
o Users are presented with a menu for different operations such as
managing patients, doctors, appointments, and billing.
2. Functions
o Each operation is implemented as a separate Python function to
modularize the code and make it easy to maintain.
3. MySQL Connectivity
o Python connects to the MySQL database using the MySQL Connector
library.
PYTHON-MYSQL CONNECTIVITY:-
Menu-Driven Python Program:-
Result of Implementation:-
The system successfully stores and retrieves hospital data.
It reduces manual work and paper usage.
The program is easy to use and error-free.
Python functions ensure modular and structured
programming.
MySQL ensures secure and organized data storage.
OUTPUT SCREENS / TESTING
This section shows the successful execution and
testing of the Hospital Management System.
Different test cases were performed to verify that the
system works correctly and produces accurate
results.
🔹 Test Case 1: Program Menu Output
When the Python program is executed, the following
menu is displayed on the screen.
This menu allows the user to select different operations.
Output Screen (Menu Display):-
Result: -The menu is displayed
successfully, allowing the user to interact
with the system.
______________________________________________
🔹 Test Case 2: Data Insertion Output (Add Patient)
When option 1 (Add Patient) is selected, the
program asks for patient details.
The patient details are stored successfully in the
MySQL database.
🔹 Test Case 3: Record Display Output (View
Patients)
When option 2 (View Patients) is selected, all
stored patient records are displayed.
Patient records are retrieved correctly from the
database and displayed on the screen.
🔹 Testing Summary:-
Test Case Description Status
1 Menu Display Successful
2 Data Insertion Successful
3 Record Display Successful
🔹 Conclusion of Testing:-
All modules of the Hospital Management System
were tested successfully.
The program performed all operations accurately
without errors.
The outputs confirm proper Python–MySQL
connectivity and correct implementation of
database operations.
ADVANTAGES AND LIMITATIONS
The Hospital Management System has been
developed to computerize the basic operations of
a hospital.
Like any software system, it has several
advantages as well as certain limitations.
🔹 Advantages of Hospital Management System
1. Time Saving
The system reduces the time required for
maintaining and searching patient records as
compared to manual record keeping.
2. Reduced Paper Work
All patient and doctor details are stored
digitally, reducing the use of paper and
physical files.
3. Easy Data Retrieval
Patient records can be retrieved quickly using
MySQL queries, improving efficiency.
4. Data Accuracy
The chances of human errors are reduced due
to computerized data entry and storage.
5. Better Data Management
The use of MySQL database helps in
organizing large amounts of data in a
structured manner.
[Link]-Friendly Interface
The menu-driven Python program is easy to
understand and operate even for non-technical
users.
[Link] Data Storage
The system provides better security than manual
systems, as data is stored in a database and
accessed through authorized programs.
[Link] System
The project can be expanded in the future to
include more modules like pharmacy, laboratory,
and staff management.
🔹 Limitations of Hospital Management System
1. Limited Functionality
The project is designed for a small-scale
hospital and does not include advanced
modules such as online appointments or
billing gateways.
2. Requires Computer Knowledge
Basic knowledge of operating a computer is
required to use the system effectively.
3. Dependent on Hardware
The system cannot function properly in case of
hardware failure or power issues.
4. Internet/Software Dependency
MySQL and Python must be properly installed
on the system for smooth functioning.
5. Security Limitations
Advanced security features like encryption
and role-based access are not implemented in
this project.
6. Not Web-Based
The project is a desktop-based application
and cannot be accessed remotely.
____________________________________________________
🔹 Summary
The Hospital Management System is an
efficient and reliable solution for managing
hospital records digitally.
Although it has certain limitations, it fulfills the
objectives of the project and meets all CBSE
Class 12 Computer Science practical
requirements.
______________________________________________
FUTURE SCOPE
The Hospital Management System developed in
this project fulfills the basic requirements of
managing hospital records. However, the system
can be further enhanced in the future by
incorporating advanced features and
technologies.
🔹 Future Enhancements
1. Online Appointment System:-
In the future, the system can be upgraded to
allow patients to book appointments online
with doctors. This will reduce waiting time and
improve patient convenience.
2. Cloud-Based Database:-
The MySQL database can be shifted to a cloud
platform, enabling real-time access to hospital
data from different locations. This will improve
data availability, backup, and scalability.
3. Mobile Application Integration:-
A mobile application can be developed for
patients and doctors to access hospital
services such as appointment scheduling,
medical records, and notifications through
smartphones.
[Link] Security Features:-
Additional security measures like user
authentication, data encryption, and role-based
access control can be implemented to enhance
data protection.
[Link] with Other Modules
The system can be expanded to include
pharmacy management, laboratory reports, and
billing systems for complete hospital
automation.
🔹 Conclusion of Future Scope
With these enhancements, the Hospital
Management System can be transformed into a
complete, modern, and scalable solution suitable
for large hospitals and healthcare organizations.
CONCLUSION:-
The Hospital Management System project has been
successfully designed and implemented using Python as
the front-end and MySQL as the back-end database. The
main objective of the project was to computerize the
basic operations of a hospital and to reduce the
problems associated with manual record keeping.
Through this project, various hospital activities such as
storing patient records, managing doctor details, and
retrieving information efficiently have been
implemented. The use of a database ensures proper
organization of data, reduces redundancy, and improves
data accuracy. The menu-driven Python program makes
the system user-friendly and easy to operate.
The project helped in understanding the practical
application of Python–MySQL connectivity, database
management concepts, and structured programming
techniques. It also enhanced problem-solving skills and
provided hands-on experience in developing a real-life
application.
Although the system has certain limitations, it fulfills all
the objectives defined at the beginning of the project and
meets the requirements of the CBSE Class 12 Computer
Science practical examination. With further
enhancements, this project can be extended into a fully
automated and advanced hospital management solution.
BIBLIOGRAPHY:-
The following books, websites, and resources were
referred to during the development of the Hospital
Management System project. These sources helped in
understanding Python programming, MySQL database
concepts, and Python–MySQL connectivity.
1. NCERT Computer Science Textbook, Class XII, CBSE
2. Python Official Documentation
[Link]
3. MySQL Official Documentation
[Link]
4. MySQL Connector/Python Documentation
[Link]
5. W3Schools – SQL Tutorial
[Link]
6. GeeksforGeeks – Python & MySQL Tutorials
[Link]
7. Notes and guidance provided by the Computer Science
teacher