Consider the data dictionary below for a patient diagnosis case. Use this dictionary to answer questions a-e.
Table Attributes Data type Length Primary Foreign key? key?
Patient PatientID INT 8 Yes No
Ename Varchar 100 No No
Surname Varchar 100 No No
Age Int 10 No No
Diagnosis D_ID INT 8 Yes No
Type Varchar 150 No No
Fee Decimal 10 No No
PatientID INT 8 No Yes
a) Implement the above database using MySQL. (5 Marks)
b) Create a trigger to be fired each time a new record is added to the diagnosis table. (3 Marks)
c) Create a new user called cashier who can add, select, and update records in this database. (3 Marks)
d) Create a transaction for adding, updating, and deleting a record in the patient table. The transaction allows the user to rollback to some specified save points. (4 Marks)