Practical SQL Task- Hospital Management System
Practical SQL Task- Hospital Management System
Scenario:
You have been hired as a database administrator for a hospital. Your task is to design and
implement a Hospital Management System (HMS) using MySQL. The system should efficiently
manage patient records, doctor assignments, medical history, and billing.
Task Breakdown:
Design and create tables for managing hospital operations with the following structure:
Tables:
1. Patients
FirstName
LastName
Gender
PhoneNumber
Address
BloodType
InsuranceNumber
2. Doctors
DoctorID (Primary Key)
FirstName
LastName
Specialization
PhoneNumber
Department
3. Appointments
AppointmentDate
Diagnosis
Prescription
ConsultationFee
4. MedicalHistory
DateRecorded
ConditionDiagnosed
TreatmentGiven
5. Billing
AmountDue
DateOfBill
PaymentMethod
---
2. Data Insertion
---
Basic Queries:
1. Retrieve all appointments for a given patient, including the doctor's name and specialization.
2. Find all patients treated by a specific doctor.
Advanced Queries:
6. Retrieve patients who have had more than three appointments in the last year.
8. Identify patients who have been diagnosed with Diabetes at least twice.
Modification Queries:
10. Delete records of patients who haven't had an appointment in the last 5 years.