Computer Science 304

Similar documents
The University of British Columbia Computer Science 304 Practice Final Examination

CSE 444, Winter 2011, Midterm Examination 9 February 2011

The University of British Columbia

Question Marks 1 /20 2 /16 3 /7 4 /10 5 /16 6 /7 7 /24 Total /100

CPSC 121 Midterm 1 Friday October 14th, Signature: Section (circle one): 11:00 15:30 17:00

Question Marks 1 /12 2 /6 3 /14 4 /8 5 /5 6 /16 7 /34 8 /25 Total /120

Full Name: CS Account:

EXAMINATION INSTRUCTIONS

THE UNIVERSITY OF BRITISH COLUMBIA CPSC 110: MIDTERM 1 Part B May 26, Important notes about this examination

EXAMINATION INSTRUCTIONS

CPSC 121 Some Sample Questions for the Final Exam Tuesday, April 15, 2014, 8:30AM

CPSC 121 Sample Final Examination December 2013

Question Marks 1 /16 2 /13 3 /12 4 /15 5 /8 6 /15 7 /8 8 /5 9 /8 Total /100

Question Marks 1 /11 2 /4 3 /13 4 /5 5 /11 6 /14 7 /32 8 /6 9 /11 10 /10 Total /117

This examination has 11 pages. Check that you have a complete paper.

THE UNIVERSITY OF BRITISH COLUMBIA CPSC 121: MIDTERM 2 Group March 12, 2014

The University of British Columbia Final Examination - December 02, 2014 Mathematics 308. Closed book examination. No calculators.

EXAMINATION INSTRUCTIONS

UNIVERSITY REGULATIONS

CPSC 121 Midterm 1 Friday February 5th, Signature: Section (circle one): Morning Afternoon

The University of British Columbia

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #1 Examination 12:30 noon, Tuesday, February 14, 2012

CPSC 320 Midterm 2. July 13, 2007

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #2 Examination 12:30 noon, Thursday, March 15, 2012

230 Chapter 17. (c) Otherwise, T writes O and WTS(O) is set to TS(T).

CSE 444 Midterm Exam

Administrivia. CS186 Class Wrap-Up. News. News (cont) Top Decision Support DBs. Lessons? (from the survey and this course)

CSE 344 Midterm. November 9, 2011, 9:30am - 10:20am. Question Points Score Total: 100

THE UNIVERSITY OF BRITISH COLUMBIA CPSC 261: MIDTERM 1 February 14, 2017

The University of Oregon May 16, 2015 Oregon Invitational Mathematics Tournament:

Queen s University Faculty of Arts and Science School of Computing CISC 432* / 836* Advanced Database Systems

CS145 Midterm Examination

CS 186 Databases. and SID:

UNIVERSITY REGULATIONS

CPSC 410 Advanced Software Engineering Mid-term Examination (Term I ): Solution Instructor: Gail Murphy

McGill April 2009 Final Examination Database Systems COMP 421

CPSC 411, 2015W Term 2 Midterm Exam Date: February 25, 2016; Instructor: Ron Garcia

1. (a) Briefly explain the Database Design process. (b) Define these terms: Entity, Entity set, Attribute, Key. [7+8] FIRSTRANKER

Midterm Exam #2 (Version A) CS 122A Winter 2017

COMPSCI/SOFTENG 351 & 751. Strategic Exercise 5 - Solutions. Transaction Processing, Crash Recovery and ER Diagrams. (May )

CS 411 Midterm Feb 2008

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Database Systems: Fall 2008 Quiz I

CSE 444 Midterm Exam

CPSC 311, 2010W1 Midterm Exam #2

PLEASE HAND IN UNIVERSITY OF TORONTO Faculty of Arts and Science

PLEASE HAND IN UNIVERSITY OF TORONTO Faculty of Arts and Science

CS145 Midterm Examination

The University of Oregon May 16, 2015 Oregon Invitational Mathematics Tournament:

EXAMINATION INSTRUCTIONS

IMPORTANT: Circle the last two letters of your class account:

Name Class Account UNIVERISTY OF CALIFORNIA, BERKELEY College of Engineering Department of EECS, Computer Science Division J.

Database Systems. Announcement

Sankalchand Patel College of Engineering, Visnagar B.E. Semester III (CE/IT) Database Management System Question Bank / Assignment

The University of British Columbia

Final Review. CS634 May 11, Slides based on Database Management Systems 3 rd ed, Ramakrishnan and Gehrke

MATH 253/101,102,103,105 Page 1 of 12 Student-No.:

CPSC 310: Database Systems / CSPC 603: Database Systems and Applications Final Exam Fall 2005

CISC437/637 Database Systems Final Exam

2011 DATABASE MANAGEMENT SYSTEM

Name :. Roll No. :... Invigilator s Signature : DATABASE MANAGEMENT SYSTEM

1 (10) 2 (8) 3 (12) 4 (14) 5 (6) Total (50)

CSE 344 Midterm. November 9, 2011, 9:30am - 10:20am. Question Points Score Total: 100

Database Management Systems Paper Solution

CPSC 410? Advanced Software Engineering Mid-term Examination (Term I ) SOLUTION Instructor: Gail Murphy

CSE 444, Fall 2010, Midterm Examination 10 November 2010

EXAMINATION INSTRUCTIONS

CISC437/637 Database Systems Final Exam

UNIVERSITY OF CALIFORNIA College of Engineering Department of EECS, Computer Science Division

Introduction to Data Management. Lecture #26 (Transactions, cont.)

CS348: INTRODUCTION TO DATABASE MANAGEMENT (Winter, 2011) FINAL EXAMINATION

THE UNIVERSITY OF BRITISH COLUMBIA CPSC 304: MIDTERM EXAMINATION SET A OCTOBER 2016

CS/B.Tech/CSE/New/SEM-6/CS-601/2013 DATABASE MANAGEMENENT SYSTEM. Time Allotted : 3 Hours Full Marks : 70

DATABASE MANAGEMENT SYSTEMS

Final Review. Zaki Malik November 20, 2008

Unit 10.5 Transaction Processing: Concurrency Zvi M. Kedem 1

INSTITUTO SUPERIOR TÉCNICO Administração e optimização de Bases de Dados

CSE 344 Final Examination

Example Examination. Allocated Time: 100 minutes Maximum Points: 250

The University of British Columbia

Bachelor in Information Technology (BIT) O Term-End Examination

CSE 344 Midterm. Wednesday, February 19, 2014, 14:30-15:20. Question Points Score Total: 100

CSCE 4523 Introduction to Database Management Systems Final Exam Spring I have neither given, nor received,unauthorized assistance on this exam.

Final Exam. December 5th, :00-4:00. CS425 - Database Organization Results

Database Administration and Tuning

CSCE 4523 Introduction to Database Management Systems Final Exam Fall I have neither given, nor received,unauthorized assistance on this exam.

Introduction. Examination, INF3100, No examination support material is allowed

Solutions to Final Examination

AC61/AT61 DATABASE MANAGEMENT SYSTEMS JUNE 2013

READ AND OBSERVE THE FOLLOWING RULES:

Homework 2: Query Processing/Optimization, Transactions/Recovery (due February 16th, 2017, 9:30am, in class hard-copy please)

Babu Banarasi Das National Institute of Technology and Management

Security and Authorization

6.830 Lecture Recovery 10/30/2017

Midterm Exam (Version B) CS 122A Spring 2017

UNIVERSITY REGULATIONS

CSE344 Final Exam Winter 2017

CSE 344 Final Examination

CSE 344 Final Exam. March 17, Question 1 / 10. Question 2 / 30. Question 3 / 18. Question 4 / 24. Question 5 / 21.

Solutions. Updated of 7

Transcription:

The University of British Columbia Computer Science 304 Final Examination Instructor: Rachel Pottinger Time: 2.5 hours Total marks: 48 Name ANSWER KEY (PRINT) (Last) (First) Signature This examination has 9 pages of questions printed double-sided (5 pieces of paper total). Check that you have a complete exam. This is a closed book exam, closed notes exam. Answer all the questions on this paper. Give short but precise answers. Write down any assumptions that you make. The marks for each question are given in {}. Use this to manage your time. Good Luck! READ AND OBSERVE THE FOLLOWING RULES: 1. Each candidate should be prepared to produce, upon request, his or her UBC Card. 2. No candidate shall be permitted to enter the examination room after the expiration of one-half hour, or to leave during the first half-hour of the examination. 3. Candidates are not permitted to ask questions of the invigilators, except in cases of supposed errors or ambiguities in examination questions. 4. CAUTION --- Candidates guilty of any of the following, or similar, dishonest practices shall be immediately dismissed from the examination and shall be liable to disciplinary action. a. Making use of any books, papers or memoranda, calculators or computers, phones, MP3 players, or other memory aid devices, other than those authorized by the examiners. Mark Out of 2 10 3 10 4 4 5 4 6 4 7 6 8 6 9 4 Total 48 b. Speaking or communicating with other candidates. c. Purposely exposing written papers to the view of other candidates. The plea of accident or forgetfulness shall not be received.

Question 1. {10 marks} F A J G C E D I H B F Transform the ER diagram into a relational schema using the methods discussed in class/the book. If there are any conflicting attribute names, rename them something appropriate and easy to understand. State any assumptions that you make but your assumptions cannot contradict the facts given. a. {12 marks} What should the relational schema be? You do NOT have to create SQL DDL, just underline the keys and note foreign keys and not null constraints after the relation definition, e.g., you might have M(n,o): foreign key (o) references R(q), o is not null b. {4 marks} Are there any constraints in the relational schema that cannot be modeled without using assertions? If so, which constraint(s)? If not, why not? Page 2

Question 2. {10 marks} Consider the schema R(A, B, C, D, E) together with the functional dependencies: BD A AB C D A B C C E Is R in 3NF? Why or why not? If not, decompose into 3NF using the method we used in class and the book and circle all relations in your final answer. Show all your work. Page 3

Question 3. {4 marks} Given the relation: Sailors(sid, sname, rating, age), consider the following query: Find the names of sailors with a higher rating than all sailors with age < 21. The following two SQL queries attempt to obtain the answer to this question. Query A: SELECT S.sname FROM Sailors S WHERE S.rating > ANY ( SELECT S2.rating FROM Sailors S2 WHERE S2.age < 21) Query B: SELECT S.sname FROM Sailors S WHERE NOT EXISTS ( SELECT * FROM Sailors S2 WHERE S2.age < 21 AND S.rating <= S2.rating) For each of the two questions below, circle your answer: A. Does Query A compute the correct answer? Yes No B. Does Query B compute the correct answer? Yes No Page 4

Question 4. {4 Marks} Consider the relation Arc with the following current values: Arc x y 1 2 1 2 2 3 3 4 3 4 4 1 4 1 4 1 4 2 Compute the result of the query: SELECT a1.x, a2.y Count(*) FROM Arc a1, Arc a2 WHERE a1.y = a2.x GROUP BY a1.x, a2.y Which of the following is a row in the result? Circle a single correct answer. a. (1,3,2) b. (4,2,6) c. (4,3,1) d. All of the above e. None of the above Page 5

Question 5. {4 Marks} Suppose R(a,b) and S(b,c) are relations. Consider the Datalog query: T(x,y) :- R(2,x), S(y,x) Write an equivalent relational algebra expression: Page 6

Question 6. {6 marks} Consider the following concurrency protocols: 2PL, Strict 2PL, Time Stamp without the Thomas Write rule, Timestamp with the Thomas Write Rule, and Multiversion Timestamps. For each of the following schedules, circle whether it is allowed under the above protocols. If you cannot decide whether a schedule is allowed based on the listed actions, explain briefly. The actions are listed in the order they are scheduled and prefixed with the transaction name. If a commit or abort is not shown, the schedule is incomplete; assume that abort or commit must follow all the listed actions. a. T1:R(X), T2:R(X), T1:W(X), T2:W(X) 1. 2PL? Yes No Can t tell: 2. Strict 2PL? Yes No Can t tell: 3. Timestamp w/ TWR? Yes No Can t tell: 4. Timestamp w/o TWR? Yes No Can t tell: 5. Multiversion timestamps? Yes No Can t tell: b. T1:W(X), T2:R(Y), T1:R(Y), T2:R(X) 1. 2PL? Yes No Can t tell: 2. Strict 2PL? Yes No Can t tell: 3. Timestamp w/ TWR? Yes No Can t tell: 4. Timestamp w/o TWR? Yes No Can t tell: 5. Multiversion timestamps? Yes No Can t tell: Page 7

Question 7. {6 marks} Consider the following sequence of actions using the ARIES protocol: LSN LOG 00 begin checkpoint 10 end checkpoint 20 update: T1 writes P5 30 update: T2 writes P3 40 T2 commit 50 T2 end 60 update: T3 writes P3 70 T1 abort <CRASH, RESTART> Assume that the Dirty Page Table and Transaction Table were empty before the start of the log. a. What is done during Analysis? (Be precise about the points at which Analysis begins and ends and describe the contents of any tables constructed in this phase.) b. What is done during Redo? (Be precise about the points at which Redo begins and ends.) c. What is done during Undo? (Be precise about the points at which Undo begins and ends.) Page 8

Question 8. {4 marks} Consider the following XML DTD: <?xml version= 1.0?> <!DOCTYPE Newspaper[ <!ELEMENT Basket (Cherry+, (Apple Orange)*) > <!ELEMENT Cherry EMPTY> <!ATTLIST Cherry flavour PCDATA #REQUIRED> <!ELEMENT Apple EMPTY> <!ATTLIST Apple colour PCDATA #REQUIRED> <!ELEMENT Orange EMPTY> <!ATTLIST Orange location Florida > ]> Where #PCDATA and CDATA are equivalent. Consider the following instance, which is designed to adhere to the above DTD. <Basket> <Apple/> <Cherry flavour= good /> <Orange/> </Basket> a. Is this instance valid? Why or why not? b. Is this instance well-formed? Why or why not? Page 9