Hospital Database 1

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Project

#2
1. Create the table below use HOSPITAL as database name.

Save table as PATIENT. Examine carefully what data type


will suit each field.
Client_cod
P1
P2
P3
P4
P5
P6
P7
P8
P9
P10

Name
Albesa, Rey
Basco, Akiko
Cruz, Daniel
De Mesa, Ana
Espejo, Star
Fernande
z, Jun
Hizon, Ivy
Intal, Sam
Tala, Ted
Umali, Joyce

Room_No
A101
B102
C101
D104
A102
B101

Age
60
45
12
55
39
32

Sex
F
M
F
M
M
F

C109
D105
B103
A105

9
18
22
34

M
M
F
F

2. Using the table PATIENT, create the following queries.


a. Display all the fields of the Client code P7. Save
query as Query1.
b. Display the name and room number of the clients
whose age ranging from 30 above. Save query as
Query2.
c. Display the name and age of all female patients. Save
query as Query3.
d. Display the client code of Umali, Joyce. Save query as
Query4.
e. Display the names of all the patients. Save query as
Query5.
f. Display all the fields of Jun Fernandez. Save query as
Query6.
g. Display the name and room number of patient P5. Save
query as Query7.

h. Display the client code, name and room number of


all male patients. Save query as Query8.
i. Display the patients name with room number
starting with letter A. Save query as Query9.
3. From the same database HOSPITAL, create new table
save table as
ROOM.
Examine carefully what data type will suit each field.
Room_No.
A101
B102

Nurse_in_Char Status
ge
Alcantara
Occupied
Beltran
Occupied

Location
1st Floor
2nd Floor

C101
D104
A102
B101
C109
D105
B103
A105

Corpuz
Navarro
Santos
Rodriguez
Torres
Regalado
Carlos
Bautista

Occupied
Occupied
Occupied
Occupied
Occupied
Occupied
Occupied
Occupied

3rd Floor
4th Floor
1st Floor
2nd Floor
3rd Floor
4th Floor
2nd Floor
1st Floor

4. Using the table ROOM create the following queries:


a. Display the Room number and its status. Save query as
Query10.
a. Display the Room number, location and the name of the
patient of all the rooms. Save query as Query11.
b. Display the client code, name and the nurse in-charge
in every room number. Save query as Query11.
c. Display the names of the nurse in charge for rooms
located in 1st floor. Save query as Query12.
d. Display the Room number of all the occupied rooms. Save
query as Query13.
e. Display the Status of rooms located in the 2nd floor. Save
query as Query14.
f. Display all the fields of room which the nurse in charge is
Torres. Save query as Query15.
5. Create new table save table as NURSE.
Examine carefully what data type will suit each field.
Emp_No. Name
Room_No Yr_in_servic
.
e
2001-1
Alcantara A101
10

2001-2
2002-1
2003-4
2008-5
2010-1
2005-2
2006-2
2001-3
2005-1

Beltran
Corpuz
Navarro
Santos
Rodriguez
Torres
Regalado
Carlos
Bautista

B102
C101
D104
A102
B101
C109
D105
B103
A105

10
9
8
3
1
6
5
10
6

6. Using the table NURSE, create the following queries:


a. Display the Room number, Emp_no, Name and its
status. Save query as Query15.
b. Display the Emp_no, Name and the years in service
of all the nurses with 5 years and above in service.
Save query as Query16.
c. Display the emp_no. of all the nurses assigned in the
1st floor. Save query as Query17.
d. Display the Emp_no. Name of all the employees
assigned in room starting with letter A. Save query
as Query18.
e. Display all the fields of Emp_no 2001-1. Save query as
Query19.
7. Depending from which table the fields can be accessed,
create the following queries.
a. Create a query to display the name of the Nurse in
Charge and name of the patient in room number A101.
Save query as Query20.

b. Create a query to display the Room number, Nurse in


Charge, and the patient name of all the room in the 1st
floor. Save query as Query21.
c. Create a query to display the Room number, Location,
Nurse in Charge, and the number of years in service of all
the nurses. Save query as Query22.
d. Create a query to display all the Employee number, Name of
the Nurse in Charge, Name of the patient and Room number.
Save query as Query23.
e. Create a query to display all the Client code, Name of
the patient, Room number, age, sex and Name of the
Nurse in Charge. Save query as Query24.

You might also like