0% found this document useful (0 votes)
9 views5 pages

CCS 2218 2016

This document outlines the examination paper for the Bachelor of Science in Software Engineering at Multimedia University of Kenya for the 2015/2016 academic year. It includes various questions related to database systems, such as ETL processes, relational data models, SQL queries, and database design for a medical clinic. Additionally, it covers topics like concurrency control, normalization, and data migration/ETL processes.

Uploaded by

tuckerluise026
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
9 views5 pages

CCS 2218 2016

This document outlines the examination paper for the Bachelor of Science in Software Engineering at Multimedia University of Kenya for the 2015/2016 academic year. It includes various questions related to database systems, such as ETL processes, relational data models, SQL queries, and database design for a medical clinic. Additionally, it covers topics like concurrency control, normalization, and data migration/ETL processes.

Uploaded by

tuckerluise026
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 5
MULTIMEDIA UNIVERSITY OF KENYA FACULTY OF COMPUTING AND INFORMATION TECHNOLOGY. UNIVERSITY EXAMINATIONS 2015/2016 SECOND YEAR SECOND SEMESTER EXAMINATION FOR THE DEGREE OF BACHELOR OF SCIENCE IN SOFTWARE ENGINEERING CCS 2218: DATABASE SYSTEMS IL YATE: WEDNESDAY 26™ APRIL, 2016 NSTRUCTIONS: ANSWER YOUR QUESTIONS IN ANSWER BOOKLET PROVIDED. ANSWER QUESTION ONE [COMPULSORYLAND.AN ER TWO QUESTIONS QUESTION ONE (THIRTY MARKS] / \ a] Briefly describe the ETL proc | si [5 marks] b] State and describe the THR! mpi that make up the relatibnal data model according to Fleming and von Halle, 1989 ’ 16 marks] c] Briefly describe a database level lock / [5 marks] [4] State 5 (FIVE) trends that encourage the need Goud pardhousing [5 marks} le] Describe location transparency and local autonomy as they relate to distributed databases: [4 marks] {f] You intend to give a flat hike to your employees using the following criteria: Salary between 30000 and 40000 -- 5000 hike Salary between 40000 and 55000 -- 7000 hike Salary between 55000 and 65000 -- 9000 hike Assuming the table name is tbl_emp and the field name is salary, write the equivalent SQL code that will make the necessary update. [5 marks] Page 1 of 5 QUESTION TWO (TWENTY MARKS] {al {b) Nyekasa Ltd have a total staff of 50. It is a medical clinic on the outskirts of Nyahurun, They lately have been having a problem with contact details in regards to addresses ang phone contaets of their staff, patients, Next of Kin and suppliers. To salvage this problen, the management hired an IT consultant to do a survey and give their recommendatioy, After the analysis was done, the consultant has concluded that the best way fix thi, problem is creating a database to hold all these details in separate tables and making. th, tables as simple as possible. He also recommended that one table for address and on telephone be used to store all contact details for the patients, staff, NOKs and Supplier, The consultant has tasked you to develop the database to hold this information. ‘I}, expected fields are as follows PATIENT (sumame, forenames, DOB, gender, nationality, marital status, religion) STAFF (sumame, forenames, date hired, active, gender, nationality, marital staty religion, department) SUPPLIER (name, locality) ADDRESS (linel, line2, line3, line4, postcode) TELEPHONE (mobile1, mobile2, mobile3, fax1, fax2, emaill, email2, email3, work! work2, work3, homel, home2) The fields gender, nationality, marital status and religion are expected to be drawn from lookup table. Create the database “Contacts” containing the said tables with the relation: constraints duly. [7 marks} ally indicative of the existence of a parent-child ich is the relationship between department and staff. ting the parent-child relationship. [4 marks) ue ma rhs | between entitiogs reate the two tables high Treate a stored ape thiit adds, updates and deletes staff meee fed, wrap these two DELETE statements within a transaction, this is done to maintain data consistency, Create a procedure DeleteDepartment to accomplish this [8 marks] QUESTION THREE (TWENTY MARKS] [a] (b] Using concurrency control with time stamping methods differentiate between the wait ¢# scheme and the wound/wait scheme [8 marks] Use the query below to answer the question that follows, SELECT country, YEAR(hiredate) AS yearhired FROM HR.Employees WHERE yearhired>~ 2003, ‘This query fails with the following error. Page 2 of § Msg 207, Level 16, State 1, Line 3 Invalid column name 'yearhired', Explain the reason this happens 15 marks} A college maintains details of its lecturers’ subject area skills, These details comprise (Lecturer Number, Lecturer Name, Lecturer Grade, Department Code, Departinent Name, Subject Code, Subject Name, Subject Level ) Assume that «Each lecturer may teach many subjects but may not belong to more than one department. * Subject Code, Subject Name and Subject Level are repeating fields. Normalize this data to Third Normal Form. [7 marks} QUESTION FOUR (TWENTY MARKS] Greenwich General Hospital has hired you as a consultant to process. They provide an extract patient.csv (structure show! tables the data in the extract maps to. You are required to load “theSex' table TempPat and use the mappings provided to complete the:pri Patient, Episode, Visit and PatientNumbers respectively (see mappings b st in their data migration/ETL jow) and the structure of the ‘data in a temporary he destination tables are if exists(select 'I' from INFORMATION_SCH ‘TempPat' and TABLE_TYPE = 'Base table’) \ drop table TempPat go create table TempPat { arrivaldate varchar(50), surname varchar(50), firstnames varchar(60), patID varchar(20), gender varchar(30), dob varchar(30), visitID varchar(30) Using the extract patient.csy provided (sample records attached), dump all the records in the tract in the temporary table TempPat. Arrival date,Patient Last Name,Patient First Name,PatientID,Gender, DOB, Visit ID 7/9/2008, Lecte,Nicola,A389917,Female,1/15/1959,ED080650051 7/9/2008,Singh Taak, Taranject,F217992,Male,1/7/2000,ED080650201 7/9/2008, Barnard, Kenneth,A588060,Male, 1/2/1959, E Patient Pat_pid Primary key autonumber empPa ame Pat_sumame tempPat.surname: Pat_forenames ‘TempPat.firstnames Pat_sex TempPat.gender Pat_dob TempPat.DOB Pat_createdby userlD of the user who adds the record Episode Epd_id primary key autonumber Epd_num (visit number in the form ED-08-065005) TempPat.visitID Epd_patpid (foreign key to patient table) _updatedatetime field, should be updated with the current date |_ createdby userID of the user who adds the record Visit \Vst_id primary key autonumber x st_epdid foreign key that links to the episode table _visitNum (visit number iy he 9 ED-08-065005-1) TempPat.visitID rivaldatedattime TempPat.arrivaldate Vst_createdby use org user who adds the record PatientNumbers \ Ptn_id primary key aut Ptn_num (all of the nunther'tyges GUID, Ptn_num'Type (lookup fordorresponding nu Ptn_patpid foreign key to 0 he Pin_update populated with the-eufféritiatesréytime a record is added Ptn_createdby userID of the user who adds the record Write SQL code to achieve the required :TL process. The SQL code to add the Patient, Episoe® Visit and Patient_ Numbers should be embedded within stored procedures. ‘The procedure should add a patient record, get the pat_pid value from the patient table and use when entering and episode and patient_ numbers record, i¢ ~ patient Pat_pid_| Pat_surname | Pat_forenames | Pat_sex 1 [| Pat_dob | Pat_createdby | Leete Nicola Female | 1/15/1959 | 6 Episode : Epd_id Epd_num Epd_patpid ~[ Epd_update : L ED-08-065005 1 | Current_time Visit eee Vs_id Vst_epdid ‘Vst_num __| Vst_arrivaldate i 1 ED-08-065005-1___| 79/2008 Patient_numbers Pin_id Ptn_num Pin_numtype [Pin_patpid 1 1 GUID 1 2 ED-08-065005 Episode NUmber 1 3 389917 Patient ID 1 ah US ges thar Z be used to identify a In the patient_Numbers table, the following are the m patient 3) GUID Global Unique Identifier) — pat ii) Episode Number ~ cpd_num iii) Patient ID - TempPat.patID The extract contains duplicate records, ensure only Create an exception report with the following structui Ex_id Patient_ID Narrati i ‘A398917 Duplicate R nelude system visibility (ongoing progress of the import) (26 marks}

You might also like