How I Built a Hospital Patient Management System Using SQL

Article Outline:
Introduction

Project Overview

Tools and Skills Used

Database Design (ERD)

Key Features of the System

Sample Queries I Ran

Challenges I Faced

Lessons Learned

GitHub Project Link

Closing Thoughts

Hello everyone, in today’s post…


This content originally appeared on DEV Community and was authored by Akanle Tolulope

Article Outline:
Introduction

Project Overview

Tools and Skills Used

Database Design (ERD)

Key Features of the System

Sample Queries I Ran

Challenges I Faced

Lessons Learned

GitHub Project Link

Closing Thoughts

Hello everyone, in today’s post, I’ll be sharing how I designed and built a Hospital Patient Management System using SQL as part of my data analyst learning journey and public project portfolio.

I built this project to strengthen my database management and SQL querying skills, while preparing for open-source opportunities like Outreachy.

Project Overview

The project involved creating a relational database to manage:

  • Patient's personal information
  • Departments
  • Diagnoses
  • Visit history
  • Risk assessments

The system makes it easy for a hospital to store, retrieve, and analyse patient data efficiently.

🛠️ Tools and Skills Used

  • SQL (DDL, DML, and queries)
  • Database design
  • ERD (Entity Relationship Diagram)
  • GitHub for project hosting and version control

Database Design

I designed a normalised database with the following tables:

  • 'Patients'
  • 'Doctors'
  • 'Visit'

They’re connected through primary and foreign key relationships.

ERD Diagram:

Key Features of the System

  • Proper use of primary and foreign keys
  • Inserted realistic sample patient and visit records
  • Wrote clean SQL queries to analyse:
    • Patient visits
    • Risk level distributions
    • Department workload reports

Sample Queries I Ran

Number of visits per patient
SELECT p.Full_Name, COUNT(v.VisitID) AS Number_of_Visits
FROM patients p
JOIN Visit v ON p.PatientID = v.PatientID
GROUP BY p.FullName;

Get All Visits with Patient & Doctor Names

SELECT V.VisitDate, P.FullName AS Patient, D.FullName AS Doctor, V.Diagnosis
FROM Visit V
JOIN Patients P ON V.PatientID = P.PatientID
JOIN Doctors D ON V.DoctorID = D.DoctorID;

Lessons Learned

  • Plan your database structure first

  • Always set up primary and foreign keys

  • Use sample data to test your queries

GitHub is a great place to showcase SQL projects publicly

Project Link
Check out the full project on GitHub:

https://github.com/Akansrodger/hospital-patient-management-system-sql

Feel free to download the .sql files and try out the queries!

Closing Thoughts
This project has improved my confidence in database design and SQL query writing. It’s one of the first of many I’ll be adding to my public portfolio.

Thanks for reading!


This content originally appeared on DEV Community and was authored by Akanle Tolulope


Print Share Comment Cite Upload Translate Updates
APA

Akanle Tolulope | Sciencx (2025-07-08T21:59:56+00:00) How I Built a Hospital Patient Management System Using SQL. Retrieved from https://www.scien.cx/2025/07/08/how-i-built-a-hospital-patient-management-system-using-sql/

MLA
" » How I Built a Hospital Patient Management System Using SQL." Akanle Tolulope | Sciencx - Tuesday July 8, 2025, https://www.scien.cx/2025/07/08/how-i-built-a-hospital-patient-management-system-using-sql/
HARVARD
Akanle Tolulope | Sciencx Tuesday July 8, 2025 » How I Built a Hospital Patient Management System Using SQL., viewed ,<https://www.scien.cx/2025/07/08/how-i-built-a-hospital-patient-management-system-using-sql/>
VANCOUVER
Akanle Tolulope | Sciencx - » How I Built a Hospital Patient Management System Using SQL. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/07/08/how-i-built-a-hospital-patient-management-system-using-sql/
CHICAGO
" » How I Built a Hospital Patient Management System Using SQL." Akanle Tolulope | Sciencx - Accessed . https://www.scien.cx/2025/07/08/how-i-built-a-hospital-patient-management-system-using-sql/
IEEE
" » How I Built a Hospital Patient Management System Using SQL." Akanle Tolulope | Sciencx [Online]. Available: https://www.scien.cx/2025/07/08/how-i-built-a-hospital-patient-management-system-using-sql/. [Accessed: ]
rf:citation
» How I Built a Hospital Patient Management System Using SQL | Akanle Tolulope | Sciencx | https://www.scien.cx/2025/07/08/how-i-built-a-hospital-patient-management-system-using-sql/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.