This project is a SQL-based database system designed to manage hospital patient records efficiently.
It includes tables for patients, doctors, appointments, and treatments, allowing users to easily retrieve and analyze hospital data.
- Store and manage patient information
- Track doctor schedules and appointments
- Manage treatment details and billing
- Generate reports and query patient history
- SQL (MySQL)
- MySQL 8.0 or higher
- MySQL Workbench or any SQL client
Hospital-Patient-Management-System/
schema.sql- Contains SQL statements for creating database tablesinsert.sql- Contains SQL statements for inserting sample dataqueries.sql- Contains SQL queries for retrieving and analyzing dataREADME.md- Project documentation
- Clone this repository or download the files
- Open MySQL Workbench and connect to your local server
- Create a new database:
CREATE DATABASE hospital_db;
USE hospital_db;- Run the SQL scripts in this order:
- First:
schema.sql(creates the database tables) - Second:
insert.sql(inserts sample data) - Third:
queries.sql(run sample queries to test)
- First:
View all patients:
SELECT * FROM patients;Get appointment details with patient and doctor names:
SELECT p.name AS patient_name, d.name AS doctor_name, a.appointment_date
FROM appointments a
JOIN patients p ON a.patient_id = p.patient_id
JOIN doctors d ON a.doctor_id = d.doctor_id;- Understanding of relational database design
- SQL joins, aggregations, and relationships
- Organizing a database project professionally