UCCD2203 Database System Assignment
UCCD2203 Database System Assignment
Stored
Procedure
(10 marks)
Function
(10 marks)
PART 2:
Total
Individual
Assessment
- 50%
PART 1 +
PART 2
= 100%
*Minus 5 marks for no DVD/CD labelling (ALL members)
*Minus 5 marks for not stapling the DVD/CD together with the assignment report. (ALL members)
*Minus 10 marks for not printing out the marking scheme (ALL members)
TABLE OF CONTENTS
2. Employee Table
Attribute Data Size Constrain Data Description Sample Data
Type t Type Forma
t
emp_ID varchar2 4 Primary Unique e001
Key identification
number for
employee
emp_first varchar2 15 First name of Alexander
employee
emp_last vrachar2 30 Last name of David
employee
emp_email varchar2 35 Email of [email protected]
employee
contact_nu NUMBER 13 999- Contact 018-678 9922
m 999 number of
9999 employee
dept_ID NUMBER 3 Foreign 009 Unique 001
Key identification
number for
department
3. Nurse Table
Attribute Data Siz Constraint Data Format Description Sample Data
Type e Type
nurse_ID varchar2 4 Primary Unique N001
Key identification
number for
nurse
emp_ID varchar2 4 Primary Unique e001
Key identification
number for
employee
4. Doctor Table
Attribute Data Siz Constraint Data Format Description Sample Data
Type e Type
doc_ID varchar2 4 Primary Unique D001
Key identification
number for
doctor
emp_ID varchar2 4 Primary Unique e001
Key identification
number for
employee
5. Billing_Info Table
Attribute Data Size Constraint Data Description Sample
Type Type Format Data
bill_ID varchar2 4 Primary Unique B001
Key identificatio
n number for
billing
bill_Date varchar2 11 The date for YYYY-
billing MM-DD
issued_emp_ID varchar2 4 Foreign Unique I001
Key identificatio
n for issued
employee ID
payment_Amount NUMBE 10 RM999.99
R
payment_Type varchar2 12 Types of Credit card
transaction
patients pay
6. Appointment Table
Attribute Data Siz Constraint Data Format Description Sample Data
Type e Type
appt_ID Varchar2 4 Primary Unique A001
Key identification
for
appointment
patient_ID Varchar2 4 Foreign Unique P001
Key identification
for patient
appt_date varchar2 9 The date of YYYY-MM-
patient’s DD
appointment
appt_time varchar2 9 The time of hh: mm: ss
patient’s
appointment
7. Appointment_Info Table
Attribute Data Size Constrain Data Format Description Sample Data
Type t Type
apptInfo_I varchar2 5 Primary Unique AI001
D Key identificatio
n for
appointment
info
bill_ID varchar2 4 Foreign Unique B001
Key identificatio
n for billing
treat_ID varchar2 4 Foreign Unique T001
Key identificatio
n for
treatment
appt_ID varchar2 4 Unique A001
identificatio
n for
appointment
8. Treatment_Record Table
Attribute Data Siz Constraint Data Format Description Sample Data
Type e Type
treat_ID varchar2 4 Primary Unique T001
Key identification
for treatment
check_ID varchar2 4 Foreign Unique C001
Key identification
for checking
nurse_ID varchar2 4 Foreign Unique N001
Key identification
for nurse
9. Patient Table
Attribute Data Siz Constraint Data Format Description Sample Data
Type e Type
10. CheckInOut Table
Attribute Data Siz Constraint Data Format Description Sample Data
Type e Type
2. Employee Table
emp_ID emp_first emp_last emp_email contact_ dept_ID
num
e001 Alexander David [email protected] 01867899 001
22
e002 Russell Houle [email protected] 01722785 005
62
e003 Moira Mallin [email protected] 01252635 002
96
e004 Ross Norris [email protected] 01289754 001
22
e005 Dale Rice [email protected] 01112585 003
99
e006 Bob Salvage [email protected] 01498763 004
52
e007 Eufemia Lombardi [email protected] 01987622 006
33
e008 Doriano Esposito [email protected] 01585326 007
47
e009 Ciro Rizzo [email protected] 01652347 005
89
e010 Jerome Sims [email protected] 01695874 008
23
e011 Miranda Conner [email protected] 01956412 010
33
e012 Larry Turner [email protected] 01525789 006
52
e013 Pearl Reid [email protected] 01547899 008
66
e014 Vivian Walton [email protected] 01023365 004
97
e015 Janice Strickland [email protected] 01054789 002
95
e016 Goodwin Fuller [email protected] 01352698 010
77
3. Nurse Table
nurse_ID emp_ID
N001 e002
N002 e016
N003 e014
N004 e008
N005 e006
N006 e013
4. Doctor Table
doc_id emp_ID
D001 e001
D002 e004
D003 e003
D004 e015
D005 e011
D006 e012
D007 e010
D008 e009
D009 e005
6. Appointment Table
appt_ID patient_ID appt_date app_time
A001 P001 2021-01-02 08:45:12
A002 P012 2021-01-03 12:50:11
A003 P019 2021-01-08 01:34:12
A004 P342 2021-01-12 13:40:20
A005 P021 2021-01-13 10:30:20
A006 P003 2021-02-19 10:40:21
A007 P016 2021-03-12 09:20:23
A008 P054 2021-02-12 08:50:50
A009 P011 2021-01-19 09:15:20
A010 P064 2021-02-23 08:30:10
A011 P014 2021-03-03 10:30:23
A012 P015 2021-01-17 11:40:21
A013 P018 2021-03-19 09:34:14
A014 P042 2021-03-25 08:34:03
A015 P017 2021-01-23 09:45:10
9. Patient Table
COMMIT;
7.0 Individual Assessment ()
7.1 Queries
7.2 Stored Procedure
7.3 Function
8.0 Individual Assessment ()
8.1 Queries
8.2 Stored Procedure
8.3 Function
9.0 Individual Assessment ()
9.1 Queries
9.2 Stored Procedure
9.3 Function
10.0 Individual Assessment ()
10.1 Queries
10.2 Stored Procedure
10.3 Function