sample - scem staff linux serverzhuhan/current/vuws/current-sample... · sample final exam ......

11
SPR17 Page 1 of 11 SAMPLE FINAL EXAM – SPRING/2H SESSION 2017 School of Computing, Engineering and Mathematics Complete your details in this section when instructed by the Exam Supervisor at the start of the exam. You should also complete your details on any answer booklets provided. STUDENT SURNAME: STUDENT FIRST NAME: STUDENT ID: EXAM INSTRUCTIONS Read all the information below and follow any instructions carefully before proceeding. This exam is printed on both sides of the paper – ensure you answer all the questions. You may begin writing when instructed by the Exam Supervisor at the start of the exam. Clearly indicate which question you are answering on any Examination Answer Booklets used. UNIT NAME: Database Design and Development UNIT NUMBER: 300104 NUMBER OF QUESTIONS: 35 VALUE OF QUESTIONS: Exam questions are worth 50 marks, giving a total of 50 marks towards the final grade. ANSWERING QUESTIONS: Answers to Part A are to be written on the Multiple Choice Answer Form provided. Student should complete details of their name and student number on the Multiple Choice Answer Form. Answers to Part B should be written in the Answer Booklet provided. LECTURER/UNIT COORDINATOR: Zhuhan Jiang TIME ALLOWED: 3 hours TOTAL PAGES: 11 RESOURCES ALLOWED Only the resources listed below are allowed in this exam. No resources of any kind are allowed in this exam. DO NOT TAKE THIS PAPER FROM THE EXAM ROOM

Upload: truongkien

Post on 10-Mar-2018

214 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: SAMPLE - SCEM Staff Linux Serverzhuhan/current/vuws/current-sample... · SAMPLE FINAL EXAM ... Logical Data Independence refers to the immunity of conceptual schema ... tables should

SPR17 Page 1 of 11

SAMPLE FINAL EXAM – SPRING/2H SESSION 2017 School of Computing, Engineering and Mathematics

Complete your details in this section when instructed by the Exam Supervisor at the start of the exam. You should also complete your details on any answer booklets provided.

STUDENT SURNAME:

STUDENT FIRST NAME:

STUDENT ID:

EXAM INSTRUCTIONS

Read all the information below and follow any instructions carefully before proceeding. This exam is printed on both sides of the paper – ensure you answer all the questions. You may begin writing when instructed by the Exam Supervisor at the start of the exam. Clearly indicate which question you are answering on any Examination Answer Booklets used.

UNIT NAME: Database Design and Development

UNIT NUMBER: 300104

NUMBER OF QUESTIONS: 35

VALUE OF QUESTIONS: Exam questions are worth 50 marks, giving a total of 50 marks towards the final grade.

ANSWERING QUESTIONS: Answers to Part A are to be written on the Multiple Choice Answer Form provided. Student should complete details of their name and student number on the Multiple Choice Answer Form. Answers to Part B should be written in the Answer Booklet provided.

LECTURER/UNIT COORDINATOR:

Zhuhan Jiang

TIME ALLOWED: 3 hours TOTAL PAGES:

11

RESOURCES ALLOWED Only the resources listed below are allowed in this exam.

No resources of any kind are allowed in this exam.

DO NOT TAKE THIS PAPER FROM THE EXAM ROOM

Page 2: SAMPLE - SCEM Staff Linux Serverzhuhan/current/vuws/current-sample... · SAMPLE FINAL EXAM ... Logical Data Independence refers to the immunity of conceptual schema ... tables should

SPR17 Page 2 of 11

This page intentionally left blank

Page 3: SAMPLE - SCEM Staff Linux Serverzhuhan/current/vuws/current-sample... · SAMPLE FINAL EXAM ... Logical Data Independence refers to the immunity of conceptual schema ... tables should

SPR17 Page 3 of 11

PART A: (22 marks in total, all 31 questions are of equal weighting. To offset potential student miscomprehension of the questions, the best N questions may be counted for the answers, and the N is typically set to about 30.) Note: Please make sure you read through the complete question before answering it, as you are to pick the best answer among the given choices. Q1. A database is [a] a shared collection of logically related data [b] a description of this data in [a] [c] designed to meet the information needs of an organisation [d] all of the above [e] none of the above Q2. What does the following screenshot for Microsoft ACCESS indicate?

[a] none of the below [b] all the below [c] ownerNo is a candidate key for table PropertyForRent [d] ownerNo is a foreign key [e] attribute ownerPhone will be displayed by this query

Page 4: SAMPLE - SCEM Staff Linux Serverzhuhan/current/vuws/current-sample... · SAMPLE FINAL EXAM ... Logical Data Independence refers to the immunity of conceptual schema ... tables should

SPR17 Page 4 of 11

Q3. In the ANSI-SPARC 3 Level Architecture, which of the following is/are true? [a] Logical Data Independence refers to the immunity of conceptual schema to changes in the internal schema [b] Physical Data Independence refers to the immunity of external schemas to changes in conceptual schema [c] Logical model changes due to such as the addition of new data items should be possible without affecting existing external views [d] all of the above [e] none of the above Q4. Duties expected of a Data administrator (DA) include [a] database planning [b] development and maintenance of standards, policies and procedures [c] conceptual and logical database design [d] all of the above [e] physical database design and implementation, and all of the above Q5. Regarding the potential activities involved with each of the three main phases of database design, which of the following is not correct? [a] the conceptual database design phase includes activities such as identifying entity types, identifying relationship types, and determining attribute domains [b] the conceptual database design phase also includes activities such as determining primary and candidate key attributes, and checking model for redundancy [c] the logical database design phase includes activities such as deriving relations from the conceptual data model, validating relations using normalisation, and checking integrity constraints [d] the logical database design phase also includes activities such as designing security mechanisms for the data entry [e] the physical database design phase includes activities such as translating logical data model for the target DBMS, designing user views, and designing file organisation and indexes Q6. A weak entity type [a] does not have a unique identifier within the entity [b] can not exist on its own, in that its existence is dependent on another entity type [c] is also a strong entity type if it contains two or more attributes. [d] weakens any entity that has a direct relationship with it. [e] is only [a] and [b] of the above

Page 5: SAMPLE - SCEM Staff Linux Serverzhuhan/current/vuws/current-sample... · SAMPLE FINAL EXAM ... Logical Data Independence refers to the immunity of conceptual schema ... tables should

SPR17 Page 5 of 11

Q7. If relation Staff has the schema

Staff=(givenName, familyName, building), and has exactly the following records

givenName familyName building David Smith EA Sophie Lee EB James Bond EC Sophie Bond EB

Which of the following projections are correct? [a] ∏familyName, building is

familyName building Smith EA Lee EB Bond EC Bond EB

[b] ∏givenName, familyName is

givenName familyName David Smith Sophie Lee James Bond Sophie Bond

[c] ∏givenName, building is

givenName building David EA Sophie EB James EC

[d] all of the above [e] only [a] and [b] of the above

Page 6: SAMPLE - SCEM Staff Linux Serverzhuhan/current/vuws/current-sample... · SAMPLE FINAL EXAM ... Logical Data Independence refers to the immunity of conceptual schema ... tables should

SPR17 Page 6 of 11

Q8. The following ER diagram

implies [a] entity type Dog is a superclass of entity type MaleDog [b] entity type FemaleDog is a specialization of the entity type Dog [c] a dog (of Dog type) cannot be both male (of MaleDog type) and female (of FemaleDog type) [d] all of the above [e] only [a] and [b] of the above Q9. Suppose in a relation

R=(orderId, productId, quantity, orderDate), attribute orderId uniquely determines orderDate, and quantity fully depends on both orderId and productId. Then [a] orderId, productId → quantity, orderDate [b] orderId and productId together comprise a candidate key for the relation R [c] orderId, productId → orderDate show a partial functional dependency [d] all of the above [e] only [a] and [b] of the above Q10. The multiplicities shown in the ER diagram below

indicate [a] one staff manages at most one branch, and some branches may not be managed by any staff [b] some branches may be managed jointly by more than one staff, and some staff may not manage any branches [c] each branch has to be managed by exactly one staff, and every staff has to manage a particular branch [d] one staff may manage one or more branches, and some staff may not manage any branches

Dog

MaleDog FemaleDog

{ and }

Staff Branch Manages u

1..1 0..*

Page 7: SAMPLE - SCEM Staff Linux Serverzhuhan/current/vuws/current-sample... · SAMPLE FINAL EXAM ... Logical Data Independence refers to the immunity of conceptual schema ... tables should

SPR17 Page 7 of 11

[e] none of the above Q11. Suppose a relation R(A, B, C, D, E, F) has attributes A, B, C, D, E and F. All the functional dependencies in this relation are either included in

A → B, C, D, E E → F

or derivable there, see the diagram below

This relation is [a] in UNF, i.e. un-normalised form [b] in 1NF, but not in 2NF [c] in 2NF, but not in 3NF [d] in 3NF [e] none of the above Q12. Consider the following table of data with fields A, B, C, D, and E.

A B C D E

a b z w q

e b r w p

a d z w t Which of the following functional dependencies are consistent with the records in the above table? [a] A → C, D, E [b] A, B → C, D, E [c] B, D → C [d] all of the above [e] none of the above

A B C D E F

Page 8: SAMPLE - SCEM Staff Linux Serverzhuhan/current/vuws/current-sample... · SAMPLE FINAL EXAM ... Logical Data Independence refers to the immunity of conceptual schema ... tables should

SPR17 Page 8 of 11

Q13. For the schedule of the transactions T1 and T2 depicted in the table below in which the balx column denotes the corresponding value of balx in the database, what kind of problem is there that is caused by concurrency?

Time T1 T2 balx t1 begin_transaction 100 t2 begin_transaction read(balx) 100 t3 read(balx) balx = balx + 100 100 t4 balx = balx – 10 write(balx) 200 t5 write(balx) commit 90 t6 commit 90

[a] Lost Update problem [b] Uncommitted Dependency problem [c] Inconsistency Analysis problem [d] ACID Deficiency problem [e] none of the above Q14 … Q31. Topics may include, but are not limited to - program-data independence - recognition of some typical screenshots with ACCESS and SQL Server - super key, candidate key, primary key, foreign key, and some relational algebra - full/partial functional dependencies, normalisation: 1NF to 2NF, 2NF to 3NF - ER diagram, EER with subclassing, Relation Diagram, multiplicities, participation constraints,

disjoint constraints, mapping ERD to GRD - phases of database design and the corresponding output or artefacts - the RAID technology - Two-Phase locking, transaction property, anomalies in non-serial schedules, re-do/un-do

transactions - database security and administration

Page 9: SAMPLE - SCEM Staff Linux Serverzhuhan/current/vuws/current-sample... · SAMPLE FINAL EXAM ... Logical Data Independence refers to the immunity of conceptual schema ... tables should

SPR17 Page 9 of 11

PART B: (28 marks in total) Q32. [10 marks] Consider the following table schemas for the hotel reservation § Pet(petId, petName, sex, petTypeId*) § PetType(petTypeId, animalType, breed) § Owner(ownerId, firstName, lastName, homePhoneNumber, streetAddress, suburb, postcode) § PetAndOwner(ownerId*, petId*) in which the underlined attributes form the primary key and the starred attributes are foreign keys. Its global relation diagram is depicted below.

[a] List all the names of the pet owners and their home phone numbers in the suburb 'Parramatta'. [b] List all the nicknames owners have given to their pet of type 'cat'. [c] List all the ownerId and the total number of pets owned by this owner. [d] Create in SQL the tables for the relations Owner and PetAndOwner. Q33. [5 marks] Suppose relation R has the schema R(Order_ID, Order_Date, Customer_ID, Customer_Name, Customer_Address,

Product_ID, Product_Description, Product_Finish, Unit_Price, Order_Quantity) and has the following functional dependencies n Order_ID → Order_Date, Customer_ID, Customer_Name, Customer_Address n Customer_ID → Customer_Name, Customer_Address n Product_ID → Product_Description, Product_Finish, Unit_Price n Order_ID, Product_ID → Order_Quantity see also the dependency diagram below.

Page 10: SAMPLE - SCEM Staff Linux Serverzhuhan/current/vuws/current-sample... · SAMPLE FINAL EXAM ... Logical Data Independence refers to the immunity of conceptual schema ... tables should

SPR17 Page 10 of 11

Normalise the above dependency diagram into Second Normal Form (2NF) and Third Normal Form (3NF). Provide reasoning and show all your work. Draw the global relation diagram for the 3NF only. Q34-Q35. - There may be questions on simple and/or more realistic database design, SQL, and some

general database related concepts. - SQL queries may be involved with inner and outer joins, grouping and aggregate functions,

and sorting of the output. - The types of questions may vary from those in the samples.

Database Design Case Description:

A combined medical and herbal centre wants to create a database to keep track of its medics, patients, herbal medicine, and herbal prescriptions. For simplicity, both a herbal medic and a patient will be recorded for his or her name, a herbal medicine will be recorded for its name, unit and the price per unit, and a prescription will be recorded for its date, the patient and medic, and all the herbs included in the prescription. [a] For the conceptual database design phase, design your database in terms of an Entity-Relationship (ER) diagram. This ER diagram should include explicitly the primary keys, the participation multiplicities for the relationship type/s. State the additional assumptions, if any, that are crucial to the design in your final ER diagram.

(The ER diagrams for this and the following questions must adopt the symbols, notations, and styles used throughout the textbook by Connolly and Begg.) [4 marks] [b] For the logical database design phase, map the final ER diagram into the global relation diagram. Indicate all the primary keys, foreign keys, multiplicity constraints, as well as at least the crucial attributes. (Here “crucial” is in regard to the database design, not necessarily to the needs of business information.) [3 marks] [c] Write an SQL script (of statements) that generates at least 2 tables for your designed database in above with proper primary keys and foreign keys if any. At least one of these 2 tables should contain a foreign key that is related to at least one of the tables you created via SQL here. [2 marks]

Page 11: SAMPLE - SCEM Staff Linux Serverzhuhan/current/vuws/current-sample... · SAMPLE FINAL EXAM ... Logical Data Independence refers to the immunity of conceptual schema ... tables should

SPR17 Page 11 of 11

Notes for Q32-Q35. - The Hotel-Booking model in Tutorial 6 may be used to write SQL queries. - The normalisation examples in the tutorials and in the lecture notes will be helpful. - Revise SQL with JOIN, AGGREGATE functions, etc. - Know how to design a database. - The case study in the last question is for illustration only. It does not imply that the case

study in the final exam will be similar in any way in its business nature.

END OF EXAM PAPER

NOTES/HINTS: n This sample examination paper is a sample for the format of the exam only. While the

content covered here is examinable, many other examinable materials are not covered here.

n Students should rationalise their time during the final examination. Easier questions sometimes may weigh more in terms of the allocated marks. Students should make sure that they also spend sufficient time on seemingly easier questions so as not to lose easy marks carelessly.

n Please bear in mind that all topics can be put into the form of multiple choice questions, and just about all short or medium answers can be cast into MCQ. Hence do revise on everything.

n This sample paper is not purposed to drill your knowledge and skills, which is already done during the whole semester. As such, there will be no formal answers available to any of these questions. This is just like we cannot supply all answers to all the exercise questions in the textbook.