You are on page 1of 36
/6 [ +68/ Office Use Onl Sect BQS_| Sect BQ6 | ‘MONASH UNAVERSITY LIBRARY ee SeationA [SeckB QI [Set BQ2 [Searls 03" Seal S474] Monash University 004124663 Semester Two Examination Period 2011 Faculty of Information Technology EXAM CODES: FIT1004 TITLE OF PAPER: Data Management EXAM DURATIO! 3 hours writing time READING TIME: 10 minutes THIS PAPER IS FOR STUDENTS STUDYING AT-:( tick where applicable) (Berwick 0 Clayton J Malaysia.) Off Campus Leaning Open Learning (Caulfield 8 Gippsland Peninsula C1 Enhancement Studies [J Sth Aftica Pharmacy 1 Other (specify) During an exam, you must not have in your possession, a book, notes, paper, electronic devicels, calculator, pencil case, mobile phone or other material/item which has not been authorised for the exam or specifically permitted as noted below. Any material or item on your desk, chair or person will bbe deemed to be in your possession, You are reminded that possession of unauthorised materials in an exam isa discipline offence under Monash Statute 4.1 ‘No examination papers are to be removed from the room. Attempt all questions. All answers must be printed neatly on this paper. Answer questions with concisely expressed factual information. The backs of pages in this paper may be used for any rough work. Any material written on the backs of pages will not normally be marked. If an answer needs to overflow from its designated answer space to a blank page, clearly indicate that this is the ‘case and that the material on the blank page is for correction. This paper must be handed up at the end of the examination, even if no questions are attempted. The marks for each question are shown. Total marks for the examination: 100. ‘This exam counts as 50% of the final assessment for the unit AUTHORISED MATERIALS CALCULATORS Dyes BNO OPEN BOOK O yes No SPECIFICALLY PERMITTED ITEMS. O ves BNO Candidates must complete this section STUDENT ID DESK NUMBER Page | of 36 ‘This page may be used for any rough work. Material written on this page will not be marked unless there is a clear indication that written material on this page should be included in the answer. Page 2 of 36 Section A: Multiple Choice Section This section is worth 10 marks. Each question is worth 0.5 mark. Mark your selection by placing a v or a X through your selected answer for example © oF 3K Ifyou change your selection during the review of your paper, prior to the end of the Examination, make sure that the alteration is clear. Note: There is only ONE correct answer for each question. Multiple Choice Identify the choice that best completes the statement or answers the question. 1. The___query combines rows from two queries and excludes duplicates. a. UNION INTERSECT b. UNION ALL. 4. MINUS 2. A(n)___ specifically reserves access to the transaction that locked the object. a. shared lock c. binary lock b. exclusive lock 4d. deadiock 3. A___ entity has a primary key composed of the primary keys of each of the two related entities. a. bridge ©. unary b.supertype 4. binary 4. BCNF can be violated only ifthe table contains more than one ___key. a. primary c. foreign b. candidate 4. secondary 5. One important inheritance characteristic is that all-entity subtypes inherit their key attribute from their supertype. a. primary foreign b. natural d. surrogate 6. Assume you are using the INTERSECT operator to combine the results from two tables of identical structures and attributes, CUSTOMER and CUSTOMER _2. The CUSTOMER table contains 10 rows, while the CUSTOMER _ 2 table contains 7 rows. Only customers Dunne and Olowski are included in the CUSTOMER table as well as in the CUSTOMER 2 table.___ records are retumed when using the INTERSECT operator. a 0 7 b 2 4. 10 7. The SQL aggregate function that gives the number of rows containing not aull values for the given column is a. COUNT ©. MAX b. MIN d. SUM Page 3 of 36 ‘This page may be used for any rough work. Material written on this page will not be marked unless there is a clear indie: ‘material on this page should be included in the answer. that written Page 4 of 36 8. Every XML document has a_. a. root element c. schema b. base tag 4. DTD 9. The relational database model enables you to view data___ rather than a. relationally, hierarchically c. physically, logically b. hierarchically, relationally 4. logically, physically 10.A(n) __ represents a particular type of object in the real world. a. attribute ¢. relationship b. entity d. constraint ILA table is in ANF if all attributes must be dependent on the primary key, and must be dependent on each other all attributes are unrelated no row can contain two or more multivalued facts about an entity. ‘no column contains the same values pose 12.The existence of a(n) ___ relationship indicates that the minimum cardinality is 1 for the mandatory entity. a. mandatory c. multivalued b. optional d._single-valued 13.A derived attribute. a. must be stored physically within the database b. need not be physically stored within the database . has many values 4. must be based on the value of three or more attributes 14.In an outer join, the matched pairs would be retained and any unmatched values in the other table would beleft___. in another table null ‘out of the results with matching values from the or aoge inal table 15. Another word for existence-independent is__. a. weak cc. unary b. alone d._ strong 16.In the context of a database table, the statement “A __B” indicates that if you know the value of attribute A, you can look up the value of attribute B. a. contains ©. owns b. is related to 4, determines 17.A ___ is any key that uniquely identifies each row. a. superkey c. selective b. special d. candidate Page 5 of 36 This page may be used for any rough work. Material written on this page will not be marked unless there is a clear i material on this page should be included in the answer. Page 6 of 36 18.__keys work with primary keys to properly implement relationships in the relational model. a. Foreign c. Natural b. Composite d. Surrogate 19.All primary key entries are unique, and no part of a primary key may be a. zero null b. a forcign key d. a candidate key 20.A consistent database is__ a, One in which all tables have foreign keys b. One in which all data integrity constraints are satisfied ¢. One in which all tables are normalized d, One in which all SQL statements only update one table at a time [20 x 0.5 = 10 marks} Page 7 of 36 This page may be used for any rough work. Material written on this page wi ‘material on this page should be included in the answer. Page 8 of 36 Section Short Answer Section This section is worth 90 marks. Question I Formats, metadata and data quality (10 marks) Farina North isa private hospital. ‘Table | shows a sample of data entries from its admissi Name Ailment/ Ward Admitted Attending Condition physician John Smith Lung cancer Cancer 27 Dec 2010 Chen ‘Smith, George R, | Gunshot trauma | Emergency 185-2011 Jacobs LE, Smith Lung cancer| Cancer 2152011 ‘Chen Amanda Jones Pregnancy Obstetrics 15 June 2011 Dr Liz Jones Mabel Brown. 7 Orthopaedics 2011-09-14 Dr Williams (@) Using any of the entries as an example, show how you could increase the granularity of the (b) () data. Explain at least one advantage of increasing the granularity this way, as well as any potential disadvantages. [3 marks] Identify any quality issues that are apparent in the entry of data in the table, Describe measures the hospital could use to avoid these problems if it replaced paper forms with online data entry, (3 marks} ‘The hospital administration is keen to participate in a proposed national system that will combine medical data from many different hospitals. For this purpose the government department requires the addition of detailed metadata to support data in the table. The Dublin Core standard includes 15 possible fields for expressing metadata. List any four of these. For ‘each one explain its meaning and give an example to show how it would apply to the hospital data, [4 marks} Page 9 of 36 This page may be used for any rough work. Material written on this page will not be marked unless there is a clear indication that written ‘material on this page should be included in the answer. Page 10 of 36 Question 2 Entity Relationship Modelling (20 marks) United Helpers is a nonprofit organization that provides aid to people after natural disasters. ‘+ Individuals volunteer their time to carry out the tasks of the organization. For each volunteer, their name, address, and telephone number are tracked. Each volunteer may be assigned to several tasks during the time that they are doing volunteer work, and some tasks require many volunteers. It is possible for a volunteer to be in the system without having been assigned a task yet. [tis possible to have tasks that no one has been assigned. When a volunteer is assigned to a task, the system should track the start time and end time of that assignment. * For each task, there, is a task code, task description, task type, and a task status. For example, there may be a task with task code “101,” description of “answer the telephone,” a type of “recurring,” and a status of “ongoing” There could be another task with a code of “102,” description of “prepare 5000 packages of basic medical supplies,” a type of “packing,” and a status of “open.” + Forall tasks of type “packing,” there is a packing list that specifies the contents of the packages. There are many different packing lists to produce different packages, such as basic medical packages, child care packages, food packages, etc. Each packing list has an 1D number, a name, and a description, which describes the specific contents that ideally go into ‘making that type of package. ‘The contents are described in the description in general terms. For example, the packing list may specify that "2 litres of iodine" should be included in a given type of package without specifying whether it should be two 1-litre bottles of iodine or four 500m! bottles of iodine. Every packing task is associated with only one packing list. A packing list may not be associated with any tasks, or may be associated with many tasks. ‘Tasks that are not packing tasks are not associated with any packing list. ‘+ Packing tasks result in the creation of packages. Each individual package of supplies that is produced by the organization is tracked. Each package is assigned an ID number. The date the package was created, and the total weight of the package are also recorded, A given package is associated with only one task, Some tasks (e.g., “answer the phones”) will not have produced any packages, while other tasks (e.g., “prepare 5000 packages of basic medical supplies”) will be associated with many packages. + The packing list describes the ideal contents of each package, but itis not always possible to include the ideal number of each item. Therefore, the actual items included in each package should be tracked. A package can contain many different items, and a given item can be used in many different packages. + For each item that the organization provides, an item ID number, item description, item value, and item quantity on hand are stored in the system. Along with tracking the actual items that are placed in each package, the quantity of each item placed in the package must be tracked too, For example, a packing list may state that basic medical packages should include 100 bandages, 4 litres of iodine, and 2 litres of hydrogen peroxide. However, because of the limited supply of items, a given package may include only 10 bandages, 2 500 ml bottles of iodine, and no hydrogen peroxide. The fact that this package includes bandages and iodine needs to be recorded along with the quantity of each that is included. It is possible for the organization to have items donated that have not been included in any package yet, but every package will contain at least one item. Create a relational Logical Model to represent the data requirements described above for United Helpers. Your model must * Include all necessary attributes, and + Name all relationships. (20 marks) Page I of 36 ‘This page may be used for any Material written on this page will not be marked unless there is a clear indie: material on this page should be included in the answer. Page 12 of 36 United Helpers ~ Logical Model Diagram Page 13 of 36 This page may be used for any rough work. Material written on this page will not be marked unless there is a clear indication that written ‘material on this page should be included in the answer. Page 14 of 36 ‘Question 3 Logical Model and the SQL Create Table Statement (10 marks) (a) Drugs are prescribed for a patient. A conceptual ER model of the scenario is shown below: PATIENT patient id [PK] patient_name patient_address patient_phone In addition to the data above the date the drug is prescribed and the number of repeat scripts, which have been authorised, are to be recorded. The number of repeats is not permitted to be larger than 10. Convert the conceptual ERD above into a logical model, including the extra items are to be recorded. [5 marks] Page 15 of 36 ‘This page may be used for any rough work. Material written on this page will not be marked unless there is a clear indic material on this page should be included in the answer. jon that written Page 16 of 36 (b) Using the logical model you designed for part (a), write the SQL statements needed to create the table that contains the attributes to represent the date the drug is prescribed and the number of repeat scripts. Your schema should include a primary key definition, as well as appropriate referential integrity references and at least one example of a column check and a named constraint. {5 marks} Page 17 of 36 This page may be used for any rough work, ‘Material written om this page will not be marked unless there is a clear i material on this page should be included in the answer, Page 18 of 36 Question 4 Normalisation (10 marks) Suppose you are given the following business rules to form the basis for a database design. The database must enable the manager of a company dinner club to mail invitations to the club’s members, to plan the meals, to keep track of who attends the dinners, and so on. * Each dinner serves many members, and each member may attend many dinners. * Agiven dinner, identified by a dinner code, includes a fixed entree (first course) and desert (last course). As an example, the dinner on the 1$-Mar-201 | has a fixed entree of stuffed crab and a fixed desert of chocolate mousse with raspberry sauce. * A given dinner may be used on multiple dates. Different dinners may be run on the same date. * The manager sends an invitation to each member to attend a particular dinner to be held on a particular date. All invites for a dinner are not necessarily sent on the same date. + When a member accepts the invitation they respond to indicate that they can or cannot attend the dinner. Because the manager is not a database expert, the first attempt at creating the database uses the following structure: Attribute Name ‘Sample Value Sample Value Sample Value MEMBER_NUM. 214 235 214 MEMBER_NAME_ Alice B. VanderVoort_| Gerald M. Gallega Alice B. VanderVoort MEMBER_ADDRESS 325 Meadow Park 123 Rose Court 325 Meadow Park MEMBER CITY Murkywater Highlight Murkywater MEMBER _ZIPCODE 12345 12349 12345 DINNER_CODE DIS. DIS DI2 DINNER_DATE. 15-Mar-2011 15-Mar-2011 17-Mar-2011 DINNER_DESCRIPTION _| Glowing sea delight Glowing sea delight | Ranch Superb_ ENTREE CODE EN3 EN3 ENS ENTREE DESCRIPTION _| Stuffed crab Stuffed crab Marinated steak DESERT CODE DES DES DE2 DESERT DESCRIPTION | Chocolate mousse | Chocolate mousse | Apple pie with honey with raspberry sauce __| with raspberry sauce_| crust INVITE_DATE_ 23-Feb-2011 21-Feb-2011 12-Mar-2011 ACCEPT_DATE 27-Feb-2011 23-Feb-2011 15-Mar-2011 DINNER_ATTENDED Yes Yes No a) Draw a dependency b) Convert the table shown above to Third Normal Form (3NF), showing each stage of the process. Clearly state any assumptions that you make. Use only attributes in the table. Do not add any new ones. In completing your answer you may abbreviate the attribute names displayed eg. MEMBER_NUM to MEM_NUM, DINNER_DESCRIPTION to DIN_DESC, ete Page 19 of 36 ‘This page may be used for any rough work. Material written on this page will not be marked unless there is a clear indication that written material on this page should be included in the answer, Page 20 of 36 (a) Dependency Diagram [4 marks] Page 21 of 36 ‘This page may be used for any rough work. Material written on this page will not be marked unless there is a clear indication that written on this page should be included in the answer. Page 22 of 36 (b) Normalisation UNF 5 NE te Is (6 marks} Page 23 of 36 This page may be used for any rough work. Material written on this page will not be marked unless there is a clear indication that written material on this page should be included in the answer. Page 24 of 36 Question 5 SQL. (30 marks) Appendix A shows the logical mode! for part of the record system of a small private hospital. Also provided is the schema file for creating the database structure. Using SQL, write commands to provide the following reports or operations for the database. @ () (c) @ © List the id and name of every patient the hospital. Using the headings “NUMBER” and "NAME, list the number and name of the wards in alphabetical order. List the id, surname and date of admission of patients admitted after the 21" of August 2011, ordered by date of admission Define a sequence that can be used to assign id numbers to new patients, starting 100, 101, etc. Also provide a separate SQL statement to test that the sequence works. . List the surnames of all patients of Dr Jones. Page 25 of 36 ‘This page may be used for any rough work. written on this page will not be marked unless there is a clear indie: 1 on this page should be included in the answer. Page 26 of 36 () For each patient list their sumame, the name of their ailment and the name of their ward. (@) List all the doctors who specialize in the ailment suffered by the patient whose surname is Thomas. (ny the id and surname of every patient who suffers from cancer but whose treatment has not included an X-ray. (List the ward names, together with the number of patients in each, in descending order of the ‘number of patients Page 27 of 36 This page may be used for any rough work. I written on this page will not be marked unless there is a clear indication that w: n this page should be included in the answer. Page 28 of 36 oO (k) wo @ List the ward number and ward name of the ward/s, which have the most patients? Provide a list of all patients who have not undergone any treatment. Create a view of all the treatments (with dates) given to the patient whose surname is Davidson Create a view of all Dr Chen’ patients and the histories of their treatments [24249 +34+349+2424242+24242= 30 marks] Page 29 of 36 This page may be used for any rough work. Material written on this page will not be marked unless there is a clear indication that written material on this page should be included in the answer. Page 30 of 36 ‘Question 6 Transaction Management (10 marks) a) Given the two transactions listed below, write out all the possible serial schedules. Read item(X [write iemgyy —_[- —_] (2 marks) b) Draw a wait-for graph for the following transaction sequence and use your diagram to state if the sequence depicted TI TI T2 TI T3 12 12, 3 73 deadlock. Explain your conclusion about the deadlock status. WA) wi) B) Commit B) A) B) (A) wal [4 marks} Page 31 of 36 This page may be used for any rough work. ‘Material written on this page will not be marked unless there is a clear indication that written ‘material on this page should be included in the answer. Page 32 of 36 ©) Shared locks (S), in contrast with exclusive locks (X), improve the amount of concurrency in a system, i) Explain the meaning of each of the highlighted sections of this sentence ii) Explain the overall sentence [Gx 1) +1 =4 marks} END OF EXAMINATION QUESTIONS APPENDIX A FOLLOWS Page 33 of 36 Appendix A: Private Hospital Database Patient Treatment [Patient_id: NUMERIC ( PK} }+—— ——_—_______ -ae{T_number: INTEGER [PK] undergoes —defP_firstname: VARCHAR(20) [Tr_date: DATE | Pisurname: VARCHAR(40) lFname: VARCHAR(1O) [ FK |} jadmission: DATE (NUMERIC(10) [ FK | ——~4fpatient_id: NUMERIC _[ FK ] ¥ IDr_id: NUMERIC(LO) [ FK ] |A_code: NUMERIC(10) [ FK ]} ward_no: NUMERIC_[FK J | l r | eceemenc ny Pc) | al 3 | | \ a! 2 ~——~—~ 2 ‘ Z| suffers from | 3! | 3| | £1 *I a) Ailment | =| : 6 [A_code: NUMERIC(10) [ PK] | “| Facility | | | Frame: VARCHAR(10) [ PK ] i [Ailment_name: VARCHAR(20} | | ' lward_no: NUMERIC _[ FK] ldescription: VARCHAR(100)| | ¥ t | | Dr_id: NUMERIC(1O) (FK} ! | pp" | (hanaies: | Doctor é | { LL — — — —ggDr_id: NUMERICTO) [PK] 3 | Hi & a Specializes i" Jor surname: vARCHARGO | 3 | - [Dr_firsiname: VARCHAR(10)-4+— — [ward_no: NUMERIC [PK | lno_of_patients: INTEGER lward_name: VARCHAR(zO)] \A_code: NUMERIC(10) [FK ]} All the tables are created by the SQL statements below: CREATE TABLE WARD ( ward_no NUMBER(5) NOT NULL, WARD VARCHAR2(20) NOT NULL, CONSTRAINT WARD_PK PRIMARY KEY (ward_no) vu CREATE TABLE AILMENT ( AILMENT_CODE NUMBER(S) NOT NULL, AILMENT_NAME VARCHAR2(20) NOT NULL, ward_no NUMBER NOT NULL, CONSTRAINT AILMENT PK PRIMARY KEY (AILMENT_CODE) Mu CREATE TABLE DOCTOR ( DR_ID NUMBER(10) NOT NULL, DR_SURNAME VARCHAR2(10) NOT NULL, DR_FIRSTNAME VARCHAR2(10) NOT NULL, no_of_patients NUMBER, AILMENT_CODE NUMBER(10) NOP NULL, CONSTRAINT DOCTOR_PK PRIMARY KEY -(DR_ID) Page 34 of 36 CREATE TABLE FACILITY ( FNAME VARCHAR2(10) NOT NULL, description VARCHAR2(100) NOT NULL, DR_ID NUMBER(10) NOT NULL, CONSTRAINT FACILITY_PK PRIMARY KEY (FNAME) ” CREATE TABLE PATIENT ( PATIENT_ID NUMBER NOT NULL, P_FIRSTNAME VARCHAR2(20) NOT NULL, P_SURNAME VARCHAR2(40) NOT NULL, ADMISSION DATE NOT NULL, DR_ID NUMBER(10) NOT NULL, AILMENT_CODE NUMBER(10) NOT NULL, ward_no NUMBER NOT NULL, CONSTRAINT PATIENT_PK PRINARY KEY (PATIENT_ID) Mu CREATE TABLE TREATWENT ( ‘T_NUMBER NUMBER NOT NULL, ‘TR_DATE DATE NOT NULL, FNAME VARCHAR2(10) NOT NULL, DR_ID NUMBER(10) NOT NULL, PATIENT ID NUMBER NOT NULL, CONSTRAINT TREATMENT_PK PRIMARY KEY (T_NUMBER) ” ALTER TABLE PATIENT ADD CONSTRAINT ASSIGNED_TO FOREIGN KEY (ward_no) REFERENCES WARD (Ward_no) NOT DEFERRABLE; ALTER TABLE AILMENT ADD CONSTRAINT AILMENT_WARD_PK FOREIGN KEY (ward_no) REFERENCES WARD (ward_no) NOT DEFERRABLE; ALTER TABLE PATIENT ADD CONSTRAINT SUFFERS_FROM FOREIGN KBY (AILMENT_CODE) REFERENCES AILMENT (AILMENT_CODE) NOT DEFERRABLE; ALTER TABLE DOCTOR ADD CONSTRAINT AILMENT_DOCTOR_FK FOREIGN KEY (AILMENT CODE) REFERENCES AILMENT (ATLMENT_CODE) NOT DEFERRABLE; ALTER TABLE PATIENT ADD CONSTRAINT CARES_FOR FOREIGN KEY (DR_ID) REFERENCES DOCTOR (DR_ID) NOT DEFERRABLE; ALTER TABLE TREATMENT ADD CONSTRAINT PRESCRIBES FOREIGN KEY (DR_ID) REFERENCES DOCTOR (DR_1D) NOT DEFERRABLE; Page 35 of 36 AUIER TABLE FACILITY ADD CONSTRAINT SUPERVISES PORETCH KEY (OR_TD) ! REFERENCES DOCTOR (DR_10) Nor DErERRABL! ALTER TABLE TREATMENT ADD CONSTRAINT CARRIES_OUT FOREIGN KEY (FNAME) REFERENCES FACILITY (FNAME) NOT DEFERRABL! ALTER TABLE TREATMENT ADD CONSTRAINT UNDERGOES FOREIGN KEY (PATIENT_ID) REFERENCES PATIENT (PATIENT_ID) NOT DEFERRABLE; END OF APPENDIX A ND OF EXAMINATION Page 36 of 36

You might also like