Ict450 SQL Exercise Question
Ict450 SQL Exercise Question
INSTRUCTIONS TO CANDIDATES
1. This question paper consists of TWO (2) parts, PART A and PART B.
2. Answer ALL questions.
Total Marks 40
SQL / Output
You need to develop a Hospital Jasin Database System based on the following requirements:
1. Create a blank Access database in the Microsoft Access and save as:
“YourFullName_StudentID.accdb”
(1 mark)
6. Create a relationship for these tables. Put a checkmark in the box labeled Enforce Referential
Integrity.
(1 mark)
7. Enter the following data and add TWO (2) additional rows of data entry for the DOCTOR
table:
(1 mark)
8. Enter the following data and add TWO (2) additional rows of data entry for the PATIENT
table:
111 Chang Ngan Ying JC 2088, Jalan LKP 16, 77000 Male 017-1234567
Jasin, Melaka
222 Ibrahim Bin Hanafi JC 404, Taman Maju, 77000 Male 012-4327889
Jasin, Melaka
444 Ibrahim Bin Ali 1234, Kampung Buluh Gading, Male 017-6778899
Manir 21200 Kuala
Terengganu, Terengganu
(1 mark)
9. Enter the following data and add TWO (2) additional rows of data entry for the WARD table:
(1 mark)
10. Enter the following data and add TWO (2) additional rows of data entry for the DUTY table:
(1 mark)
Based on database you have created in Part A, write SQL statements and screenshot of your Microsoft
Access’s output for the following queries:
(2 mark)
2. Insert a new doctor data with the following:
(2 marks)
(2 marks)
4. Display the doctors’ full name and their expertise who oversees patient name ‘Ibrahim’;
(2 marks)
(2 marks)
(2 marks)
7. Display total number of duties that has been assigned for each doctor.
(2 marks)
8. Display total number of doctors who are on duty for each ward.
(2 marks)
9. Display total number of doctors who are on duty for each ward from 1-May-2023 to 16-May-2023.
(2 marks)
10. List the doctor’s name and expertise who are not assigned to any duty for any wards.
(2 marks)
11. Trace the history of patient name ‘Lee Mei Ling’. Display the patient name, ward name, diagnosis,
date diagnose and the doctor’s name on duty.
(2 marks)
(2 marks)
13. List the WardID that currently holds number of patients less than 5.
(2 marks)
14. Update the diagnosis into Stomach Cancer for Patient ID = 222.
(2 marks)
15. Update the age for Patient ID = 222 and Patient ID = 444. Both of them is 21.
(2 marks)