In Class Assignment Practical
In Class Assignment Practical
01 .Design the following Database to store data in a Medical Information Systems used in a hospital using Mysql. You must select appropriate data types for data based on their context. (i) PATIENT (PATIENT_ID, P_FNAME, P_LNAME, DATE_OF_BIRTH, SEX, AGE, ADDRESS, GUARDIAN_NAME) DOCTOR (DOCTOR_ID, D_FNAME, D_LNAME, DATE_OF_BIRTH, SEX, SPECIALIZATION_AREA, LEVEL, ADDERSS, EMM_CONTACT_NO, BASIC_SALARY, WARD_ID)
(ii)
(iii)
WARD (WARD_ID, DOCTOR_IN_CHARGE, NURSE_IN_CHARGE, NO_OF_BEDS, TYPE_OF_WARD) EMPLOYEE (EMPLOYEE_ID, E_FNAME, E_LNAME, DATE_OF_BIRTH, SEX, ADDERESS, DESIGNATION, BASIC_SALARY, WARD_ID)
(iv)
(v)
PATIENT_ADMISSION (ADMISSION_NO, PATIENT_ID, WARD_ID, DATE_ADMITTED, PRELIMINARY_DIAGNOSTIC_RECORD, PRIMARY_DOCTOR) MEDICATION_RECORDS (MEDICATION_ID, ADMISSION_NO, DATE_PRESCRIBED, MEDICATION_DATA, STATUS, POST_MEDICATION_SYMTOMS)
(vi)
02. Insert sample records for the above created database so that the foreign key constraints can be shown. Insert at least 5 records for each table. (Before insert the records to the database read the next question.)
03. Write sql queries to retrieve the flowing information from the database that you have created in sql server. i ii iii Write SQL statements to retrieve the first name and last name of all doctors working in the ward where Mr. Sarath is admitted after 01/11/2008. Find the minimum, maximum and average salary of the doctors from the selected one ward as you prefer. Write SQL statements to retrieve the first name and last name of all female employees working in the ward where Dr. Nimal is the ward in-charge.
iv v vi
Retrieve all the doctors salary whose salary is between $3000 and $4000. Retrieve all the doctors name along with their EMM_CONTACT_NO. Retrieve all the information about all the information about patients whose age bellow 18.