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

Submitted To: MR Mujtaba Memon Submitted By: Samia Shoaib Maheen Nabil Gabol Syed Ali Raza

The document is a letter of acknowledgement and letter of transmittal submitted by students Samia Shoaib, Maheen Nabil Gabol, and Syed Ali Raza to their lecturer Mr. Mujtaba Memon regarding their term project on a hospital database. The students thank Mr. Memon for his guidance and for assigning them this practical project. They also present their report on the hospital database which covers all concepts taught in the computer applications class. The report includes tables, queries, and forms related to the hospital database.

Uploaded by

Ali Gul
Copyright
© Attribution Non-Commercial (BY-NC)
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)
47 views

Submitted To: MR Mujtaba Memon Submitted By: Samia Shoaib Maheen Nabil Gabol Syed Ali Raza

The document is a letter of acknowledgement and letter of transmittal submitted by students Samia Shoaib, Maheen Nabil Gabol, and Syed Ali Raza to their lecturer Mr. Mujtaba Memon regarding their term project on a hospital database. The students thank Mr. Memon for his guidance and for assigning them this practical project. They also present their report on the hospital database which covers all concepts taught in the computer applications class. The report includes tables, queries, and forms related to the hospital database.

Uploaded by

Ali Gul
Copyright
© Attribution Non-Commercial (BY-NC)
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/ 35

SUBMITTED TO: MR MUJTABA MEMON

SUBMITTED BY: SAMIA SHOAIB


MAHEEN NABIL GABOL
SYED ALI RAZA
Letter of Acknowledgement

Institute of Business Management

Korangi Creek, Karachi-75190, Pakistan

UAN (9221)111-002-004, Fax: (9221) 509-0968

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

Maheen Nabil Gabol


Syed Ali Raza

2|P a g e
Letter of Transmittal

Institute of Business Management

Korangi Creek, Karachi-75190, Pakistan

UAN (9221)111-002-004, Fax: (9221) 509-0968

Http://www.iobm.edu.pk

December 8, 2021

Mr. Mujtaba Memon


Lecturer,
IOBM

Dear Mr.Mujtaba Memon,


We are presenting this report based on the Hospital database. This report contains all the
concepts that were taught to us in the ‘COMPUTER APPLICATIONS 2’. We have tried to cover
all the aspects which were required in the report.
Sincerely yours,
Samia Shoaib
Maheen Nabil Gabol
Syed Ali Raza

3|P a g e
CONTENTS

TABLES.............................................................................................................................................................................6

DESCRIPTION OF TABLES................................................................................................................................................7

DOCTOR DETAILS........................................................................................................................................................7

HOSPITAL INVESTMENT:............................................................................................................................................8

LAB RECORDS..............................................................................................................................................................9

OPERATION DETAILS................................................................................................................................................10

Patient admission and discharge details.................................................................................................................11

Patient personal details...........................................................................................................................................12

Payment records......................................................................................................................................................13

Pharmacy inventory.................................................................................................................................................14

PHARMACY RECORDS:.............................................................................................................................................15

Rooms details...........................................................................................................................................................16

STAFF DETAILS..........................................................................................................................................................17

Treatment details....................................................................................................................................................18

Visiting doctor details..............................................................................................................................................19

QUERIES........................................................................................................................................................................20

1. ALL POSITIVE LAB TEST...................................................................................................................................20

2. Doctors from dha............................................................................................................................................20

3. Female doctors................................................................................................................................................20

4. Investor with 50k+ amount............................................................................................................................20

5. Investors with less than 20k amount.............................................................................................................21

6. MALE DOCTORS...............................................................................................................................................21

7. Patients having due amount...........................................................................................................................21

8. Patients named ali..........................................................................................................................................22

9. PATIENTS OF POLYCYSTIC OVARIAN SYNDROME WHO WERE CURED.........................................................22

4|P a g e
10. Patients who stayed for more than 60 days..............................................................................................23

11. ROOMS OCCUPIED FOR MORE THAN 100 DAYS.......................................................................................23

12. Staff earning less than $1000 per month...................................................................................................24

13. Staff more than 35 years old......................................................................................................................24

14. Top 5 investors............................................................................................................................................24

15. Total medicine cost per patient:................................................................................................................25

16. Unsuccessful operations.............................................................................................................................25

17. Visiting doctors coming from DHA between 7:30-10:30...........................................................................25

FORMS..........................................................................................................................................................................26

Form showing details of the doctor:.......................................................................................................................26

Form showing details of hospital investment.........................................................................................................27

Form showing patients personal details.................................................................................................................27

Form showing staff details.......................................................................................................................................28

report........................................................................................................................................................................29

relationships..................................................................................................................................................... 30

E-R DIAGRAM.................................................................................................................................................... 31

5|P a g e
TABLES

A database is a collection of tables. Table is a kind of matrix formation representing an entity. It


is a collection of attributes representing an entity. These attributes provides further details
regarding the entity involved.

The hospital database consists of the following 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

doctor_i doctor_na address gende E-mail Fee Doctor_Specia


d me r charge lty
d per
visit

DR-101 Firasat DHA, Male [email protected] 1500 General


Hussain phase 2 Physical

DR-102 Abdul DHA, Male [email protected] 2500 Child Specialist


MajId Phase 7 om

DR-103 Farhan PECHS, Male [email protected] 1000 Surgeon


Agha block 8 om

DR-104 Faisal Khan PECHS, Male [email protected] 500 Cardiologist


block 3

DR-105 Basit Mniar Clifton, Male [email protected] 2000 General


block 5 m Physical

DR-106 Muneeb Clifton, Male [email protected] 1300 Surgeon


Rehman block 6

DR-107 Saad Korangi Male [email protected] 1200 Cardiologist


Mughal crossing

DR-108 Nadia Jamil Nazimabad Femal [email protected] 1000 Gynaecologist


, block D e m

TEXT TEXT TEXT/ME TEXT TEXT NUMBE TEXT


MO R

PRIMA N/A N/A N/A N/A N/A N/A


RY KEY

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

Investor Investment_Descri Investment_Am Investor_Na Investment_


_id ption ount me Date

INV-101 Memo Text $50,000.00 Unilever 7/1/2010

INV-102 Memo Text $2,500.00 P&G 10/13/2010

INV-103 Memo Text $20,000.00 AKUH 7/7/2010

INV-104 Memo Text $320,000.00 A Hospital 10/12/2010

INV-105 Memo Text $21,500.00 B Hospital 9/8/2010

INV-106 Memo Text $12,544.00 C Hospital 9/7/2010

INV-107 Memo Text $12,000.00 D Hospital 9/21/2010

INV-108 Memo Text $21,000.00 E Hospital 11/15/2010

INV-109 Memo Text $15,000.00 F Hospital 11/16/2010

INV-110 Memo Text $65,000.00 G Hospital 11/17/2010

INV-111 Memo Text $84,000.00 H Hospital 12/2/2010

INV-112 Memo Text $74,000.00 I Hospital 11/8/2010

8|P a g e
INV-113 Memo Text $45,000.00 J Hospital 12/2/2010

INV-114 Memo Text $987,000.00 K Hospital 12/4/2010


DATA TYPE
INV-115 Memo Text $456,000.00 L Hospital 12/1/2010

TEXT MEMO NUMBER TEXT DATE/TIME

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

LAB-101 PT-101 DR- Hepatitis A, HIV Positive 2 $200.00


101

LAB-102 PT-102 DR- HIV Positive 3 $300.00


102

LAB-103 PT-103 DR- Blood Test, Negative 1 $500.00


103 Platelet Count,

9|P a g e
Urine Test

LAB-104 PT-104 DR- Hepatitis C, Urine Negative 2 $3,000.00


104 Test

LAB-105 PT-105 DR- Hepatitis B, Negative 3 $4,000.00


105 Hepatitis C, Urine
Test

TEXT TEXT TEXT TEXT/MEMO TEXT NUMBER NUMBER

PRIMARY FOREIG FORE N/A N/A N/A N/A


KEY N KEY IGN
KEY

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

Operation_Theatre_Id Patient_Id Doctor_Id Operation_Reason Operation_Results

10 | P a g e
OT-101 PT-101 DR-101 Memo /Text Successful

OT-102 PT-102 DR-102 Memo /Text Successful

OT-103 PT-103 DR-103 Memo /Text Unsuccessful

OT-104 PT-104 DR-104 Memo/ Text Successful

OT-105 PT-105 DR-105 Memo /Text Successful

OT-106 PT-106 DR-106 Memo /Text Successful

OT-107 PT-107 DR-107 Memo /Text Unsuccessful

OT-108 PT-108 DR-108 Memo/ Text Unsuccessful

OT-109 PT-109 DR-109 Memo /Text Unsuccessful

OT-110 PT-110 DR-110 Memo /Text Successful

OT-111 PT-111 DR-111 Memo /Text Successful

OT-112 PT-112 DR-112 Memo /Text Successful


KEYS
OT-113 PT-113 DR-113 Memo /Text Successful

OT-114 PT-114 DR-114 Memo /Text Successful

OT-115 PT-115 DR-115 Memo/ Text Unsuccessful

PRIMARY KEY FOREIGN KEY FOREIGN N/A N/A


KEY

TEXT TEXT TEXT TEXT/MEMO TEXT

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

Patient_Id Date_of_Admissio Date_of_Discharge status


n

PT-101 8/10/2010 5/12/2010 OK

PT-102 8/11/2010 6/12/2010 OK

PT-103 6/8/2010 4/11/2010 OK

PT-104 12/2/2010 12/17/2010 Post op

PT-105 6/8/2010 3/10/2010 Post op

PT-106 11/12/2010 12/15/2010 Post op

PT-107 10/29/2010 1/22/2011 Post op

PT-108 3/6/2010 2/7/2010 pre op

PT-109 11/25/2010 12/24/2010 pre op

PT-110 5/9/2010 5/10/2010 OK

PT-111 2/3/2010 7/6/2010 OK

PT-112 7/4/2010 5/6/2010 OK

PT-113 8/7/2010 4/9/2010 OK

PT-114 6/11/2010 2/2/2011 OK DATA TYPE


PT-115 11/20/2010 12/19/2010 OD care

TEXT DATE/TIME DATE/TIME TEXT

FOREIGN KEY N/A N/A N/A

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

patient patient_n patient_ad DOB Gen heig weig mobile_p e- domain_for_


_id ame dress der ht ht hone mai email
l

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
@

PT-111 Usama Nazimabad, 3/2/1990 mal 5'10


Ghani block A e "

N/A
N/A N/ N/A
FOREI N/A A N/A N/A N/ N/A
GN A
KEY

TEXT TEXT TEXT/MEM DATE TEX NU NU NUMBE TE TEXT


O T MBE MB R XT
R ER

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

Payment_id Patient_Id Medicine_Cost Lab_test_cos Amount_Paid


t

PY-112 PT-112 $560.00 $1,200.00 $1,200.00

PY-101 PT-101 $200.00 $200.00 $300.00

PY-102 PT-102 $500.00 $300.00 $500.00

PY-103 PT-103 $700.00 $500.00 $1,200.00

PY-104 PT-104 $300.00 $3,000.00 $3,300.00

PY-105 PT-105 $100.00 $4,000.00 $4,100.00

PY-106 PT-106 $180.00 $500.00 $600.00

PY-107 PT-107 $1,000.00 $400.00 $1,400.00


KEYS
PY-108 PT-108 $600.00 $900.00 $1,500.00 PHARMACY
INVENTORY
PY-109 PT-109 $760.00 $2,500.00 $2,500.00

PY-110 PT-110 $950.00 $5,000.00 $5,950.00 The pharmacy


DATA TYPES
inventory table
PY-111 PT-111 $250.00 $3,400.00 $3,650.00
shows the details of
PY-113 PT-113 $340.00 $500.00 $500.00 the medicine that
PY-114 PT-114 $450.00 $300.00 $450.00
are in stock, how
much quantity was
PY-115 PT-115 $300.00 $200.00 $200.00 ordered and how
PRIMARY FOREIGN N/A N/A N/A much is left with
KEY KEY and the details of
TEXT TEXT CURRENCY CURRENCY CURRENCY
their date of order
and delivery etc.

Pharmacy_Inventory

Medicine Medicine_quantity_P Medicine_quantity_o Medicine_order Medicine_delivery


_id resent rdered _date _date

MD-101 20 20 1/1/2010 2/1/2010

MD-102 90 100 1/1/2010 2/5/2010

MD-103 100 100 5/2/2010 6/7/2010

15 | P a g e
MD-104 69 69 4/3/2010 5/3/2010

MD-105 89 90 5/3/2010 6/3/2010

MD-106 56 60 4/7/2010 5/9/2010

MD-107 40 40 3/8/2010 4/10/2010

MD-108 21 25 3/9/2010 4/10/2010

MD-109 10 15 9/11/2010 10/12/2010

MD-110 98 100 4/4/2010 5/4/2010

MD-111 66 66 9/9/2010 10/10/2010

MD-112 45 60 1/10/2010 2/10/2010

MD-113 50 50 2/1/2010 3/7/2010

MD-114 100 150 3/9/2010 4/10/2010

MD-115 200 250 8/8/2010 9/8/2010

PRIMARY KEY N/A N/A N/A N/A

TEXT NUMBER NUMBER DATE/TIME DATE

KEYS DATA TYPES

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

Medicine_id Medicine_Type Medicine_amount Medicine_cost Patient_Id Date

MD-101 Syrup 50 $200.00 PT-101 11/1/2010

MD-102 Syrup 90 $500.00 PT-102 12/1/2010

MD-103 Tablet 100 $700.00 PT-103 12/2/2010

MD-104 Tablet 40 $300.00 PT-104 12/2/2010

MD-105 Tablet 10 $100.00 PT-105 12/1/2010

MD-106 Capsule 80 $180.00 PT-106 11/16/2010

MD-107 Capsule 200 $1,000.00 PT-107 11/3/2010

MD-108 Capsule 120 $600.00 PT-108 11/24/2010

MD-109 Capsule 170 $760.00 PT-109 11/25/2010

MD-110 IV 150 $950.00 PT-110 11/24/2010

MD-111 IM 300 $250.00 PT-111 11/17/2010

MD-112 IV 110 $560.00 PT-112 11/2/2010

MD-113 Tablet 50 $340.00 PT-113 11/8/2010

MD-114 Tablet 60 $450.00 PT-114 12/3/2010

MD-115 Syrup 80 $300.00 PT-115 12/4/2010

FOREIGN KEY N/A N/A FOREIGN KEY FOREIGN KEY N/A

TEXT TEXT NUMBER CURRENCY TEXT DATE/TIME

KEYS DATA TYPES

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

Room_Id Patient_Id Room_Statu Date_Of_Admission Date_Of_DISCharge


s

RM-101 PT-101 Occupied 8/10/2010 12/1/2010

RM-102 PT-102 Occupied 8/11/2010 12/2/2010

RM-103 PT-103 Vacant 6/8/2010 12/3/2010

RM-104 PT-104 Occupied 12/2/2010 12/17/2010

RM-105 PT-105 Vacant 6/8/2010 11/4/2010

RM-106 PT-106 Occupied 11/12/2010 12/15/2010

RM-107 PT-107 Occupied 10/29/2010 1/22/2011

RM-108 PT-108 Vacant 3/6/2010 6/4/2010

RM-109 PT-109 Occupied 11/25/2010 12/24/2010

RM-110 PT-110 Vacant 5/9/2010 5/10/2010

RM-111 PT-111 Vacant 2/3/2010 7/6/2010

RM-112 PT-112 Vacant 7/4/2010 11/12/2010

RM-113 PT-113 Vacant 3/3/2010 8/7/2010

RM-114 PT-114 Occupied 1/5/2010 5/6/2011

RM-115 PT-115 Occupied 11/20/2010 12/19/2010

FOREIGN FOREIGN KEY N/A N/A N/AA


KEY

TEXT TEXT TEXT DATE/TIME DATE/TIME

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

Staff_Id Staff_Name Staff_Job_Titl Gende DOB Staff_Salary(yearly Staff_Comment


e r ) s

ST-101 Majeed Janitor male 9/5/1987 $10,000.00 Memo Text


Khan

ST-102 Shakoor Janitor male 8/6/1967 $12,000.00 Memo Text


Memon

ST-103 Shazia Khan Consultant female 7/4/1967 $15,000.00 Memo Text

ST-104 Musarat Consultant female 1/26/1976 $20,000.00 Memo Text


Nazeer

ST-105 Lala Khan Janitor male 6/3/1969 $7,000.00 Memo Text

ST-106 Mehajabee Janitor female 7/4/1988 $5,000.00 Memo Text


n Mirza

ST-107 Jehangir Janitor male 10/16/196 $30,000.00 Memo Text


Tariq 4

ST-108 Mahrukh Consultant female 12/7/1976 $25,000.00 Memo Text


Yousuf

ST-109 Zulfiqar Consultant male 6/15/1988 $14,000.00 Memo Text

19 | P a g e
Shahid

ST-110 Cyrus Administrator male 2/11/1975 $8,000.00 Memo Text


Variava

ST-111 Sehrish Administrator female 4/5/1985 $10,000.00 Memo Text


Nseer

ST-112 Sundus Administrator female 2/9/1983 $15,000.00 Memo Text


Syed

ST-113 Moosa Administrator male 4/8/1985 $20,000.00 Memo Text


Shahid

ST-114 Imran Malik Consultant male 1/8/1974 $35,000.00 Memo Text

ST-115 Ashar Janitor male 6/19/1969 $25,000.00 Memo Text


Shehzad

PRIMAR N/A N/A N/A N/A N/A N/A


Y KEY

TEXT TEXT TEXT TEXT DATE CURRENCY MEMO/TEXT

KEYS DATA TYPE

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

Treatment_Id Patient_id Doctor_id Disease_Diagnosed Treatment_status

TT-101 PT-101 DR-101 malaria Cured

20 | P a g e
TT-102 PT-102 DR-102 typhoid Improvement

TT-103 PT-103 DR-103 dengue fever Cured

TT-104 PT-104 DR-104 angina Cured

TT-105 PT-105 DR-105 MI No Improvement

TT-106 PT-106 DR-106 VSD No Improvement

TT-107 PT-107 DR-107 ASD Improvement

TT-108 PT-108 DR-108 fibroids Improvement

TT-109 PT-109 DR-109 ectopic pregnancy Cured

TT-110 PT-110 DR-110 polycystic ovarian Cured


syndrome

TT-111 PT-111 DR-111 PID Improvement

TT-112 PT-112 DR-112 diabities Improvement

TT-113 PT-113 DR-113 polycystic ovarian Cured


syndrome

TT-114 PT-114 DR-114 diabities Cured

TT-115 PT-115 DR-115 PID No Improvement

PRIMARY FOREIGN FOREIGN N/A N/A


KEY KEY KEY

TEXT TEXT TEXT MEMO/TEXT TEXT

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

Visiting_Doctor_id Visiting_Doctor_Name Address Gender Timings Days

VDR-101 Shakil Gurwara DHA, phase 6 Male 9:00-12:00 Fri, Mon,


Wed

VDR-102 Khalil Ahmed DHA, phase2 Male 7:30-10:30 Sat, Thu,


Tue

VDR-103 Jamil Khan Clifton, bock 4 Male 12:30-3:30 Fri, Mon,


Wed

VDR-104 Yahya Malik Federal B Area Male 12:30-3:30 Sat, Thu,


Tue

VDR-105 Mansoor Bukahri PECHS Male 9:00-12:00 Sun

VDR-106 Faisal Alam North Male 4:00-7:00 Sun


Nazimabad, bobk
D

VDR-107 Yusra Shahid Bahadurabad Female 4:00-7:00 Sun

VDR-108 Faiza Khurram Gulistan-e- Female 7:30-10:30 Sun


Jauhar

VDR-109 Javaid Khan Clifton, block 8 Male 7:30-10:30 Sun

VDR-110 Ahmed Murtaza PECHS Male 4:00-7:00 Fri, Mon,


Wed

VDR-111 Umer Bin Waqar DHA, phase 6 Male 7:30-10:30 Sat, Thu,
Tue

VDR-112 Jehanzeb Saboor Clifton, block 5 Male 7:30-10:30 Sat, Thu,


Tue

VDR-113 Nabeel Lodhi Gulshan-e-Iqbal Male 4:00-7:00 Fri, Mon,


Wed

VDR-114 Iqra Nagi Gulshan-e-Iqbal Female 4:00-7:00 Fri, Mon,


Wed

22 | P a g e
VDR-115 Zoya Alamgir Nazimabad, bock Female 12:30-3:30 Fri, Mon,
A Wed

PRIMARY KEY N/A N/A N/A N/A N/A

TEXT TEXT TEXT TEXT DATE/TIM DATE/TIME


E

DATA TYPES

KEYS

QUERIES

1. ALL POSITIVE LAB TEST

This query shows the tests that were positive when conducted on patients.

SELECT Lab_Records.*, Lab_Records.Patient_Lab_Results

FROM Lab_Records

WHERE (((Lab_Records.Patient_Lab_Results) Like "positive"));

2. DOCTORS FROM DHA

This query shows the details of the doctor who came from DHA and the fee charged by them

SELECT doctor_details.doctor_id, doctor_details.doctor_name, doctor_details.[E-mail], doctor_details.[Fee


charged per visit], doctor_details.address

FROM doctor_details

WHERE (((doctor_details.address) Like "dha*"));

3. FEMALE DOCTORS

To show the details of all those doctors who are female

23 | P a g e
SELECT doctor_details.*, doctor_details.gender

FROM doctor_details

WHERE (((doctor_details.gender) Like "female"));

4. INVESTOR WITH 50K+ AMOUNT

To show the details of the sponsors who have invested in the hospital more than 50,000

SELECT Hospital_Investment.*, Hospital_Investment.Investment_Amount

FROM Hospital_Investment

WHERE (((Hospital_Investment.Investment_Amount)>50000));

5. INVESTORS WITH LESS THAN 20K AMOUNT

To show the investor details who have invested in the hospital less than 20,000

SELECT Hospital_Investment.*, Hospital_Investment.Investment_Amount

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.

SELECT doctor_details.*, doctor_details.gender

FROM doctor_details

WHERE (((doctor_details.gender) Like "male"));

7. PATIENTS HAVING DUE AMOUNT

24 | P a g e
To show the details of the patient and the amount which is unpaid by them.

SELECT Payment_Records.Patient_Id, Payment_Records.Payment_id, ([Payment_Records].[Medicine_Cost]+


[Payment_Records].[Lab_test_cost]-[Payment_Records].[Amount_Paid]) AS [Amount Left]

FROM Payment_Records

WHERE (((([Payment_Records].[Medicine_Cost]+[Payment_Records].[Lab_test_cost]-[Payment_Records].
[Amount_Paid]))>0));

8. PATIENTS NAMED ALI

To show the number of patients having the same name ‘ALI’

SELECT patient_personal_details.*, patient_personal_details.patient_name

FROM patient_personal_details

WHERE (((patient_personal_details.patient_name) Like "Ali*"));

9. PATIENTS OF POLYCYSTIC OVARIAN SYNDROME WHO WERE CURED

To show the details of the patient who had the disease polycystic ovarian syndrome and who
were cured

SELECT Treatment_details.Treatment_Id, Treatment_details.Patient_id,


Treatment_details.Doctor_id, Treatment_details.Disease_Diagnosed,
Treatment_details.Treatment_status

FROM Treatment_details

WHERE (((Treatment_details.Disease_Diagnosed) Like "polycystic ovarian syndrome") AND


((Treatment_details.Treatment_status) Like "cured"));

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));

11.ROOMS OCCUPIED FOR MORE THAN 100 DAYS

To show rooms that were not vacant and remained occupied for more than 100 days

SELECT Room_details.Room_Id, Room_details.Patient_Id, DateDiff("d",[Room_details].


[Date_Of_Admission],[Room_details].[Date_Of_DIScharge]) AS [Days Occupied]

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

SELECT Staff_Details.*, ([Staff_Details].[Staff_Salary(yearly)]/12) AS [Salary per month]

FROM Staff_Details

WHERE (((([Staff_Details].[Staff_Salary(yearly)]/12))<1000));

13.STAFF MORE THAN 35 YEARS OLD

To show the age details of all those staff who are above 35 years old

SELECT Staff_Details.*, DateDiff("yyyy",[Staff_Details].[DOB],Now()) AS Age

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

SELECT TOP 5 Hospital_Investment.*, Hospital_Investment.Investment_Date

FROM Hospital_Investment

ORDER BY Hospital_Investment.Investment_Date;

27 | P a g e
15.TOTAL MEDICINE COST PER PATIENT:

To show the total amount incurred by each patient on medicines

SELECT Pharmacy_Records.Patient_Id, ([Pharmacy_Records].


[Medicine_amount]*[Pharmacy_Records].[medicine_cost]) AS [Total Cost]

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

SELECT Operation.*, Operation.Operation_Results

FROM Operation

WHERE (((Operation.Operation_Results) Like "unsuccessful"));

17.VISITING DOCTORS COMING FROM DHA BETWEEN 7:30-10:30

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

WHERE (((Visiting_Doctors_Details.Address) Like "dha*") AND


((Visiting_Doctors_Details.Timings) Like "7:30-10:30"));

FORMS

FORM SHOWING DETAILS OF THE DOCTOR:

29 | P a g e
FORM SHOWING DETAILS OF HOSPITAL INVESTMENT

FORM SHOWING PATIENTS PERSONAL DETAILS

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

PATIENT ID NAME ROOMS


ROOM ID
STATUS

ADDRESS DATE OF BIRTH DATE OF DATE OF


DISCHARGE ADMISSION

34 | P a g e
35 | P a g e

You might also like