Submitted To: MR Mujtaba Memon Submitted By: Samia Shoaib Maheen Nabil Gabol Syed Ali Raza
Submitted To: MR Mujtaba Memon Submitted By: Samia Shoaib Maheen Nabil Gabol Syed Ali Raza
Http://www.iobm.edu.pk
december 8, 2021
Dear Reader,
It is an honor for us to carry out our term project which was assigned to us by our respected
teacher Mr. MUJTABA MEMON. We would like to thank Mr. MUJTABA MEMON for
providing us the guidance and the skills that will help us in preparing this project. It is a pleasure
carrying out such a term project on a topic so informative and practical.
Yours Sincerely,
Samia Shoaib
2|P a g e
Letter of Transmittal
Http://www.iobm.edu.pk
December 8, 2021
3|P a g e
CONTENTS
TABLES.............................................................................................................................................................................6
DESCRIPTION OF TABLES................................................................................................................................................7
DOCTOR DETAILS........................................................................................................................................................7
HOSPITAL INVESTMENT:............................................................................................................................................8
LAB RECORDS..............................................................................................................................................................9
OPERATION DETAILS................................................................................................................................................10
Payment records......................................................................................................................................................13
Pharmacy inventory.................................................................................................................................................14
PHARMACY RECORDS:.............................................................................................................................................15
Rooms details...........................................................................................................................................................16
STAFF DETAILS..........................................................................................................................................................17
Treatment details....................................................................................................................................................18
QUERIES........................................................................................................................................................................20
3. Female doctors................................................................................................................................................20
6. MALE DOCTORS...............................................................................................................................................21
4|P a g e
10. Patients who stayed for more than 60 days..............................................................................................23
FORMS..........................................................................................................................................................................26
report........................................................................................................................................................................29
relationships..................................................................................................................................................... 30
E-R DIAGRAM.................................................................................................................................................... 31
5|P a g e
TABLES
Doctor Details
Hospital investment
Lab records
Operation details
Patient admission and discharge details
Patient personal details
Payment records
Pharmacy inventory
Pharmacy records
Room details
Staff details
Treatments details
Visiting doctors details
6|P a g e
DESCRIPTION OF TABLES
DOCTOR DETAILS
This table contains the personal details of the doctors, their addresses, telephone numbers,
their specialization and fee charged by them.
doctor_details
7|P a g e
DATA
KEY
TYPES
HOSPITAL INVESTMENT:
This table contains the details of the various sponsors that have made investment to make the
hospital and the amount invested by them.
Hospital_Investment
8|P a g e
INV-113 Memo Text $45,000.00 J Hospital 12/2/2010
PRIMAR
Y KEY
N/A N/A N/A N/A
KEY
LAB RECORDS
This table contains the patient id who have been referred for a test at the lab along with the Dr
who has referred the test , their frequency of visit to the lab and the amount paid by them.
Lab_Records
Lab_Id Patient Doct Lab_Test_Descriptio Patient_Lab_Resul Lab_Test_Frequenc Lab_Test_Cost
_Id or_Id n ts y
9|P a g e
Urine Test
DATA TYPE
KEYS
OPERATION DETAILS
This table contains the records of the patients and the doctors who have operated them and
whether the operation performed was successful or not and the reason why the operation was
conducted.
Operation
10 | P a g e
OT-101 PT-101 DR-101 Memo /Text Successful
DATA TYPES
11 | P a g e
PATIENT ADMISSION AND DISCHARGE DETAILS
This table contains the records of the patient, their date of admission in the hospital and their
data of discharge and their status after the discharge from the hospital
Patient_Admission_&_Discharge_Details
KEY
12 | P a g e
PATIENT PERSONAL DETAILS
The patient table provides the information related to all the complete detail of the patient. It
contains the information about when did the disease start, when did it end, who was the doctor
to cure, which test were conducted, from which laboratory were they taken, This table contains
the record of all the patients, their address, phone numbers, date of birth, height, weight, etc.
patient_personal_details
PT-101 Ali Raza DHA, phase 9/5/1990 mal 5'11 85kg 0345-266- PT- yahoo.com
5 e " s 0764 123
@
PT-102 Hira Khalil DHA. Phase 4/1/1991 mal 5'2" 52kg 0332-123- PT- hotmail.com
6 e s 4567 456
@
PT-103 Aysha DHA, phase 8/24/199 mal 5'4" 47kg 0345-123- PT- yahoo.com
Ghanchi 7 1 e s 4567 789
@
PT-104 Abiha Clifton, 10/20/19 mal 5'7" 56kg 0335-123- PT- gmail.com
Zaidi block 5 91 e s 4567 159
@
13 | P a g e
PT-105 Suleman Clifton, 4/19/199 mal 5'11 65kg 1242-546- PT- gmail.com
Ahmed blaock 9 1 e " s 8845 753
@
N/A
N/A N/ N/A
FOREI N/A A N/A N/A N/ N/A
GN A
KEY
PAYMENT RECORDS
The payment record table shows the record of all the patients who have availed the services of
the hospital, their medicine and lab costs and the amount paid by them.
14 | P a g e
Payment_Records
Pharmacy_Inventory
15 | P a g e
MD-104 69 69 4/3/2010 5/3/2010
PHARMACY RECORDS:
The pharmacy record table shows the record of the medicines that are in the pharmacy, the
number of medicines their types and the cost and which patient bought it which is shown by
the patients Id number. The patient id acts as the primary key in the data base
16 | P a g e
Pharmacy_Records
17 | P a g e
ROOMS DETAILS
The room detail table shows the number of rooms in the hospital, how many rooms are
occupied and how many rooms are vacant and which patient has used the rooms on which
date.
Room_details
18 | P a g e
DATA TYPES
KEYS
STAFF DETAILS
The staff detail table shows the staff Id,their name, their occupation and personal details like
gender, date of birth, salary etc
Staff_Details
19 | P a g e
Shahid
TREATMENT DETAILS
The treatment details table shows the doctor and the patient ids. The diseases that was
diagnosed by the doctor and their results of the treatment that the doctor provided.
Treatment_details
20 | P a g e
TT-102 PT-102 DR-102 typhoid Improvement
KEYS
DATA TYPE
21 | P a g e
VISITING DOCTOR DETAILS
This table shows the record of the doctor who are not available full time at the hospital and
they visit the hospital during which timings of the day and the number of days in the week .
Visiting_Doctors_Details
VDR-111 Umer Bin Waqar DHA, phase 6 Male 7:30-10:30 Sat, Thu,
Tue
22 | P a g e
VDR-115 Zoya Alamgir Nazimabad, bock Female 12:30-3:30 Fri, Mon,
A Wed
DATA TYPES
KEYS
QUERIES
This query shows the tests that were positive when conducted on patients.
FROM Lab_Records
This query shows the details of the doctor who came from DHA and the fee charged by them
FROM doctor_details
3. FEMALE DOCTORS
23 | P a g e
SELECT doctor_details.*, doctor_details.gender
FROM doctor_details
To show the details of the sponsors who have invested in the hospital more than 50,000
FROM Hospital_Investment
WHERE (((Hospital_Investment.Investment_Amount)>50000));
To show the investor details who have invested in the hospital less than 20,000
FROM Hospital_Investment
WHERE (((Hospital_Investment.Investment_Amount)<20000));
6. MALE DOCTORS
To show the number of doctors based on their gender I.e. Male and how many are there.
FROM doctor_details
24 | P a g e
To show the details of the patient and the amount which is unpaid by them.
FROM Payment_Records
WHERE (((([Payment_Records].[Medicine_Cost]+[Payment_Records].[Lab_test_cost]-[Payment_Records].
[Amount_Paid]))>0));
FROM patient_personal_details
To show the details of the patient who had the disease polycystic ovarian syndrome and who
were cured
FROM Treatment_details
25 | P a g e
10.PATIENTS WHO STAYED FOR MORE THAN 60 DAYS
To show the details of the patients who stayed at the hospital for more than 60 days
SELECT DateDiff("d",[Patient_Admission_&_Discharge_Details].[date_of_admission],
[Patient_Admission_&_Discharge_Details].[Date_of_discharge]) AS Days,
[Patient_Admission_&_Discharge_Details].*
FROM [Patient_Admission_&_Discharge_Details]
WHERE (((DateDiff("d",[Patient_Admission_&_Discharge_Details].[date_of_admission],
[Patient_Admission_&_Discharge_Details].[Date_of_discharge]))>60));
To show rooms that were not vacant and remained occupied for more than 100 days
FROM Room_details
WHERE (((DateDiff("d",[Room_details].[Date_Of_Admission],[Room_details].
[Date_Of_DIScharge]))>=100));
26 | P a g e
12.STAFF EARNING LESS THAN $1000 PER MONTH
To show salary details of all staff who earns less than 1000 per month
FROM Staff_Details
WHERE (((([Staff_Details].[Staff_Salary(yearly)]/12))<1000));
To show the age details of all those staff who are above 35 years old
FROM Staff_Details
WHERE (((DateDiff("yyyy",[Staff_Details].[DOB],Now()))>35));
14.TOP 5 INVESTORS
To show the details of the 5 top most investors who sponsored the hospital
FROM Hospital_Investment
ORDER BY Hospital_Investment.Investment_Date;
27 | P a g e
15.TOTAL MEDICINE COST PER PATIENT:
FROM Pharmacy_Records
ORDER BY ([Pharmacy_Records].[Medicine_amount]*[Pharmacy_Records].[medicine_cost])
DESC;
16.UNSUCCESSFUL OPERATIONS
To show the number of operations that were performed and were unsuccessful
FROM Operation
To show the number of visitind doctors that visit the hospital between 7:30-10:30
SELECT Visiting_Doctors_Details.Visiting_Doctor_id,
Visiting_Doctors_Details.Visiting_Doctor_Name, Visiting_Doctors_Details.Address,
Visiting_Doctors_Details.Timings
28 | P a g e
FROM Visiting_Doctors_Details
FORMS
29 | P a g e
FORM SHOWING DETAILS OF HOSPITAL INVESTMENT
30 | P a g e
FORM SHOWING STAFF DETAILS
31 | P a g e
REPORT
32 | P a g e
RELATIONSHIPS
33 | P a g e
E-R DIAGRAM
34 | P a g e
35 | P a g e