2022 06 01 Exam
2022 06 01 Exam
Information:
• The examiner will visit the exam room at 14:45 and 15:45.
Instructions:
• You may use one A4-sized sheet with hand-written notes (front and back), but all
work must be your own. No photocopies or print-outs of slides, books, or material
off the web. If you bring a sheet of notes to the exam, it must be handed in with your
exam solutions. Please, write the exam code on it.
• Begin the answer to each question on a new page. Write page number and question
number on every page.
• Indicate clearly if you make any assumptions that are not given explicitly in the ques-
tion.
• Show ALL your work. You will get little or no credit for an unexplained answer. Please
indicate why a specific computation or transformation is appropriate. The points of
each question appear in parentheses; use this for guiding your time.
• No electronic devices of ANY kind! Please store all your devices in your bag and
not on your person. Any device found at your seat, even if it is turned off, will be
considered cheating and reported!
23 31 43
13 17 19 23 29 31 37 41 43 47
Page 2 of 5
Period 4, 2022 Advanced databases Exam
SELECT a, b, e
FROM S, T
WHERE c=d AND b>10
(a) [4 pts] For each of the query plans, explain whether it would benefit from:
(i) an index on column b
(ii) an index on column c
(iii) an index on column d
(b) [2 pts] Draw a query plan that would be more efficient than any of those given
above. Explain why the query plan would be more efficient and state whether you
assume any indexes.
Page 3 of 5
Period 4, 2022 Advanced databases Exam
(a) [3 pts] Give the Cypher statement that will be generated by the Arrows tool based
on this diagram.
(b) [2 pts] Write a Cypher query that finds the codes of courses that are given in the
MPALG programme.
(c) [4 pts] Suppose we want to store the same information as triples in a Semantic
Web database. What triples would we have?
(d) [3 pts] Give RDFS or OWL 2 statements that model the metadata describing the
classes and relationships in this example.
(e) [3 pts] Based on the triples in your answer to part (c), and assuming many other
similar triples, write a SPARQL query that finds the forenames of all teachers who
teach a course that is part of the MPDSC programme.
(f) [3 pts] Suppose that the triples in your answer to part (c) — and many other
triples — are stored in a relational database in which there is one table that has
three columns of integers, and a separate table that maps RDF terms to integers
Translate the SPARQL query in your answer to part (e) to an SQL query that ac-
cesses the relational database to find the answer.
Page 4 of 5
Period 4, 2022 Advanced databases Exam
(a) [2 pts] In 2001, a second tower with 23 floors was built. This tower was called
"Gothia West Tower". When this tower was built, the first tower was renamed
"Gothia East Tower". Draw a diagram that shows the time-based version graph
with these changes.
(b) [3 pts] In 2013, 6 floors were added to tower 1 (now with 24 floors), and in
2014 a third tower with 29 floors was built. This tower took the name "Gothia
East Tower", and tower 1 took the name "Crown Tower". Draw a diagram that
shows the time-based version graph reflecting the situation in 2014.
(c) [2 pts] Discuss how the time interval for which a data item is valid can be repre-
sented using RDF-star.
Page 5 of 5