0% found this document useful (0 votes)
210 views4 pages

COS221 EO3 v2

1. The document provides instructions for a database systems examination opportunity taking place on June 23, 2022 from 12:30 to 14:30. 2. The exam comprises 4 questions worth a total of 94 marks. Students will download the paper, write offline, scan/photograph their answers into a single PDF to upload by 14:30. 3. Students must include their details on the first page and throughout. The exam is take-home and subject to the university's integrity statement prohibiting assistance.

Uploaded by

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

COS221 EO3 v2

1. The document provides instructions for a database systems examination opportunity taking place on June 23, 2022 from 12:30 to 14:30. 2. The exam comprises 4 questions worth a total of 94 marks. Students will download the paper, write offline, scan/photograph their answers into a single PDF to upload by 14:30. 3. Students must include their details on the first page and throughout. The exam is take-home and subject to the university's integrity statement prohibiting assistance.

Uploaded by

Artemis Zeusborn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Engineering, Built Environment and IT

Department of Computer Science


Database Systems
COS 221
Examination Opportunity 3(EO3)

23 June 2022 (12:30 to 14:30)

Examiners
Internal: Dr Linda Marshall and Mr Andrew Broekman
External: Avinash Singh

Instructions
1. Read the question paper carefully and answer all the questions.
2. The assessment opportunity comprises of 4 questions on 4 pages. Refer to the table below for the marks per question.
3. 2 hours have been allocated for you to complete this paper. You will download the paper and can write it offline. You
need to photograph (make sure your photographs are clear) or scan all your pages and create a single PDF (with
.pdf extension) of your answers.
4. An upload slot will be open on the module ClickUP page under the Examination Opportunities menu option for
the duration of the examination opportunity (12:30 to 14:30) and then for an additional 30 min to give enough time
to download this paper, create the PDF containing your answers and then upload your PDF. No late submissions
will be accepted. Papers uploaded in the incorrect format will not be accepted either.
5. Make sure you include your student number, name and a picture of your student card on the first page of your
submission. Leave some space for your marks to be written on the first page. Each subsequent page of your submission
must include at least your student number and name at the top of the page.
6. This paper is take home and is subject to the University of Pretoria Integrity statement provided below.
• You are allowed to consult any literature.
• You are not allowed to discuss the questions with anyone.
• You may not copy from online resources. All answers must be in your own words.
7. If you have any queries when writing the paper, post them in good time to the COS 221 WhatsApp group or use the
chat functionality on the Blackboard Collaborate session for EO3. Make sure your post in general enough as not to
give away any answers. These two channels will be used to deliver any general information during the Examination
Opportunity.

Integrity statement:
The University of Pretoria commits itself to produce academic work of integrity. I affirm that I am aware of and have
read the Rules and Policies of the University, more specifically the Disciplinary Procedure and the Tests and Examinations
Rules, which prohibit any unethical, dishonest or improper conduct during tests, assignments, examinations and/or any other
forms of assessment. I am aware that no student or any other person may assist or attempt to assist another student, or
obtain help, or attempt to obtain help from another student or any other person during tests, assessments, assignments,
examinations and/or any other forms of assessment.

1
Question: 1 2 3 4 Total
Marks: 12 10 36 36 94

Full marks is: 85

Short Questions
1. For each of the statements given below, state whether the statement is True or False.
(a) If T1 : read item(A) and T2 : read item(A) then the order of T1 and T2 does not matter. (1)
(b) Two-phase locking protocol ensures conflict serialisability and safety from deadlocks. (1)
(c) Using checkpoints reduces overhead. (1)
(d) Active database applications augment Relational database systems with events, conditions and actions. (1)
(e) Valid and Transaction time are two time dimensions in temporal database systems. (1)
(f) Relational database systems can deal with all aspects required for spatial information storage and retrieval. (1)
(g) Content identification in multimedia databases is a manual process. (1)
(h) Search engines are an example of information retrieval systems and make use of crawlers to glean infor- (1)
mation from the web.
(i) When indexing information that has been retrieved from documents, it is necessary to invert the index. (1)
(j) A Read-Write lock combination is not compatible. (1)
(k) “No”, is the correct entry in the table for a Write lock with a Write lock combination. (1)
(l) The more strict the concurrency control, the less concurrent the transactions are. (1)
2. Complete the following sentences by filling in the missing words.
(a) A strict schedule is also (i) which in turn is (ii) . (2)
(b) The (iii) data model of which the Relational model is an example of, is too restrictive. (1)
(c) Another term for horizontal partitioning is (iv) . (1)
(d) Provide three (3) categories of NO SQL databases, (v) , (vi) and (vii) . (3)
(e) The three desirable properties of distributed systems with replicated data are: (viii) , (ix) and (3)
(x) .

Long Questions
3. Consider the relational schema comprising of the relations Guitars, Players and LastPlayed below and
answer the questions that follow.

Guitar(gId, Brand, Price)


Player(pId, Name, Age)
LastPlayed(gId, pId, Date)
(a) Identify the functional dependencies for each of the relations in the given schema. (3)
(b) For each relation in the schema, identify the primary key(s). (3)
(c) What are the relational integrity constraints for the given schema? (3)
(d) Draw an ER diagram for the schema. Assume Date can be further broken down into Year, Month and (4)
Day.
(e) Write an SQL query to retrieve dates and names of players below the age of 25 who last played Gibson (3)
brand guitars that cost more than 3000.
(f) Translate your SQL query to a Relational Algebra (RA) query. Use Natural joins when joining the tables. (3)
(g) Draw the initial query tree for the RA query given as an answer in Question 3(f) above. (3)
(h) i. What is a join selection factor ? (2)
ii. Using the idea behind join selection factor, optimise your initial query tree. (3)
iii. Translate your optimised query tree to an optimised RA query. (3)
(i) i. How does nested-loop join differ from sort-merge join? (2)

Page 2
ii. Write a simple algorithm for a nested-loop join. (4)
4. Consider the three transactions T1 , T2 , and T3 given below and answer the questions that follow.
T1 : r1 (X); r1 (Z); w1 (X);
T2 : r2 (Z); r2 (Y); w2 (Z); w2 (Y);
T3 : r3 (X); r3 (Y); w3 (Y);
(a) For each of the following schedules, draw the precedence graph and determine whether the schedule is
conflict serialisable. If the schedule is conflict serialisable, write the conflict equivalent serial schedule of
transactions (e.g., T3 ; T2 ; T1 ). If the schedule is not conflict serialisable, identify a set of conflicting
actions that prevents it from being conflict serialisable.
i. S1 : r1 (X); r2 (Z); r1 (Z); r3 (X); r3 (Y); w1 (X); w3 (Y); r2 (Y); w2 (Z); w2 (Y); (3)
ii. S2 : r1 (X); r2 (Z); r3 (X); r1 (Z); r2 (Y); r3 (Y); w1 (X); w2 (Z); w3 (Y); w2 (Y); (3)
(b) Given schedule S3 :
S3 : r3 (X); r1 (X); r2 (Z); r1 (Z); r2 (Y); w2 (Z); r3 (Y); w2 (Y); w1 (X); w3 (Y);
Assume locks have been applied to S3 as follows:
T1 T2 T3
read lock(X)
read lock(X) read item(X)
read item(X)
write lock(Z)
read itemi(Z)
read lock(Z)
read item(Z)
unlock(Z) write lock(Y)
read item(Y)
write item(Z) read lock(Y)
read item(Y)
unlock(Z)
write item(Y)
unlock(Y)
write lock(X)
write item(X) unlock(X)
unlock(X) write lock(Y)
write item(Y)
unlock(Y)
i. Which transaction follows the Two Phase Locking (2PL) protocol? (2)
ii. Apply the 2PL protocol to one of the other transactions in the schedule. (2)
iii. Which transaction makes use of lock conversion? (1)
iv. Provide an example, using the given transactions, where the transactions can result in deadlock. (3)
Explain why you say the transactions are in deadlock.
v. What benefit does strict 2PL provide? Explain the drawback to this benefit. (2)
vi. How does 2PL differ from multiple granularity locking? Use relevant examples. (6)
(c) i. How does the recovery manager ensure atomicity and durability of transactions? (2)
ii. What are the roles of the Analysis, Redo, and Undo phases in ARIES recovery algorithm? (3)
(d) Consider the execution, with a crash, given in the table below.
LSN ARIES Record
10 BEGIN CHECKPOINT
20 END CHECKPOINT
30 update T1 , P5
40 update, T2 , P3
50 COMMIT T2
60 update, T3 , P3
70 ABORT, T1
80 CRASH, RESTART
The update entries are of the form update, TransactionID, PageID. You may assume the entries in the
Transaction Table are:
(T1 , 8, in progress) and (T4 , 3, commit)
The Dirty Page Table entries are:
(P3 , 9) and (P5 , 8).
Answer the questions that follow. Be precise about the points at which every phase begins and ends.

Page 3
i. Provide the contents of the tables during the Analysis phase of the ARIES recovery algorithm. (3)
ii. What is done during Redo? (3)
iii. What is done during Undo? (3)

Page 4

You might also like