0% found this document useful (0 votes)
4 views4 pages

Hospital SQL Output Report

The Hospital Management System project aims to create a SQL-based system for managing hospital operations including patients, doctors, appointments, and medical records using MySQL. It includes the design of various tables, sample data insertion, and SQL queries for managing and retrieving data. The system enhances operational efficiency and data accessibility in healthcare settings.

Uploaded by

Aarthy C
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)
4 views4 pages

Hospital SQL Output Report

The Hospital Management System project aims to create a SQL-based system for managing hospital operations including patients, doctors, appointments, and medical records using MySQL. It includes the design of various tables, sample data insertion, and SQL queries for managing and retrieving data. The system enhances operational efficiency and data accessibility in healthcare settings.

Uploaded by

Aarthy C
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/ 4

Mini Project Report: Hospital Management System

Objective:
To develop a SQL-based system that efficiently manages various aspects of a
hospital including patients, doctors, appointments, and medical records.

Software & Technologies Used:


 Database: MySQL
 Interface Tool: MySQL Workbench / Command Line
 Language: SQL

Database Design
Tables Created:
1. departments – Stores hospital department data
2. doctors – Stores doctor information
3. patients – Stores patient details
4. appointments – Tracks appointment bookings
5. medical_records – Stores patient diagnosis and treatment history
SQL Queries
1. Create Tables
CREATE TABLE departments (
dept_id INT PRIMARY KEY,
dept_name VARCHAR(100)
);

CREATE TABLE doctors (


doctor_id INT PRIMARY KEY,
name VARCHAR(100),
specialization VARCHAR(100),
dept_id INT,
FOREIGN KEY (dept_id) REFERENCES departments(dept_id)
);

CREATE TABLE patients (


patient_id INT PRIMARY KEY,
name VARCHAR(100),
age INT,
gender VARCHAR(10),
phone VARCHAR(15)
);
CREATE TABLE appointments (
appointment_id INT PRIMARY KEY,
patient_id INT,
doctor_id INT,
appointment_date DATE,
FOREIGN KEY (patient_id) REFERENCES patients(patient_id),
FOREIGN KEY (doctor_id) REFERENCES doctors(doctor_id)
);

CREATE TABLE medical_records (


record_id INT PRIMARY KEY,
patient_id INT,
diagnosis TEXT,
treatment TEXT,
date_of_record DATE,
FOREIGN KEY (patient_id) REFERENCES patients(patient_id)
);

2. Insert Sample Data


INSERT INTO departments VALUES
(1, 'Cardiology'),
(2, 'Neurology'),
(3, 'Orthopedics');

INSERT INTO doctors VALUES


(101, 'Dr. Sharma', 'Cardiologist', 1),
(102, 'Dr. Iyer', 'Neurologist', 2),
(103, 'Dr. Patel', 'Orthopedic', 3);

INSERT INTO patients VALUES


(1, 'Anil Kumar', 45, 'Male', '9876543210'),
(2, 'Sita Rani', 60, 'Female', '9123456789');

INSERT INTO appointments VALUES


(201, 1, 101, '2025-06-10'),
(202, 2, 102, '2025-06-11');

INSERT INTO medical_records VALUES


(301, 1, 'Hypertension', 'Medication', '2025-06-10'),
(302, 2, 'Migraine', 'Lifestyle changes', '2025-06-11');

3. View All Patients


SELECT * FROM patients;

Output:
patient_id name age gender phone
1 Anil Kumar 45 Male 98765432
10
2 Sita Rani 60 Female 91234567
89

4. View Appointments by Doctor


SELECT d.name AS doctor, p.name AS patient, a.appointment_date
FROM appointments a
JOIN doctors d ON a.doctor_id = d.doctor_id
JOIN patients p ON a.patient_id = p.patient_id;

Output:

doctor patient appointment_date


Dr. Sharma Anil Kumar 2025-06-10
Dr. Iyer Sita Rani 2025-06-11

5. Medical History of a Patient


SELECT p.name, m.diagnosis, m.treatment, m.date_of_record
FROM medical_records m
JOIN patients p ON m.patient_id = p.patient_id
WHERE p.patient_id = 1;

Output:

date_of_recor
name diagnosis treatment d
Anil Kumar Hypertension Medication 2025-06-10

6. Department-wise Doctor Listing


SELECT dept_name, name AS doctor
FROM doctors
JOIN departments ON doctors.dept_id = departments.dept_id;

Output:

dept_name doctor
Cardiology Dr. Sharma
Neurology Dr. Iyer
Orthopedics Dr. Patel
Conclusion
The Hospital Management System simplifies hospital operations and ensures
secure and structured access to essential healthcare data. It demonstrates
efficient handling of medical data through SQL-based queries.

Submitted by:
Name: Preethi Varsha
Roll No: [Your Roll Number]
Department: [Your Department]
College: [Your College Name]

You might also like