0% found this document useful (0 votes)
2 views

HCMS

The document outlines the creation of a Healthcare Management System database, including tables for Patients, Doctors, Departments, Appointments, Medical History, and Billing. Each table is defined with relevant fields and primary keys, along with foreign key relationships to ensure data integrity. This structure facilitates the management of patient information, appointments, medical records, and billing processes.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

HCMS

The document outlines the creation of a Healthcare Management System database, including tables for Patients, Doctors, Departments, Appointments, Medical History, and Billing. Each table is defined with relevant fields and primary keys, along with foreign key relationships to ensure data integrity. This structure facilitates the management of patient information, appointments, medical records, and billing processes.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

CREATE DATABASE HealthcareManagementSystem;

USE HealthcareManagementSystem;

patients Table:
CREATE TABLE Patients (
PatientID INT PRIMARY KEY IDENTITY(1,1),
FirstName NVARCHAR(50),
LastName NVARCHAR(50),
DOB DATE,
Gender CHAR(1),
Address NVARCHAR(100),
PhoneNumber NVARCHAR(15),
Email NVARCHAR(50),
InsuranceNumber NVARCHAR(50)
);

CREATE TABLE Doctors (


DoctorID INT PRIMARY KEY IDENTITY(1,1),
FirstName NVARCHAR(50),
LastName NVARCHAR(50),
Specialty NVARCHAR(50),
PhoneNumber NVARCHAR(15),
Email NVARCHAR(50),
DepartmentID INT
);

CREATE TABLE Departments (


DepartmentID INT PRIMARY KEY IDENTITY(1,1),
DepartmentName NVARCHAR(50)
);

CREATE TABLE Appointments (


AppointmentID INT PRIMARY KEY IDENTITY(1,1),
PatientID INT,
DoctorID INT,
AppointmentDate DATETIME,
Reason NVARCHAR(100),
FOREIGN KEY (PatientID) REFERENCES Patients(PatientID),
FOREIGN KEY (DoctorID) REFERENCES Doctors(DoctorID)
);

CREATE TABLE MedicalHistory (


HistoryID INT PRIMARY KEY IDENTITY(1,1),
PatientID INT,
Diagnosis NVARCHAR(100),
Treatment NVARCHAR(100),
TreatmentDate DATE,
DoctorID INT,
FOREIGN KEY (PatientID) REFERENCES Patients(PatientID),
FOREIGN KEY (DoctorID) REFERENCES Doctors(DoctorID)
);

CREATE TABLE Billing (


BillingID INT PRIMARY KEY IDENTITY(1,1),
PatientID INT,
Amount DECIMAL(10, 2),
BillingDate DATE,
Paid BIT,
FOREIGN KEY (PatientID) REFERENCES Patients(PatientID)
);

You might also like