INFR10080 INTRODUCTION TO DATABASES
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
INFR10080 INTRODUCTION TO DATABASES
Question 1. Consider the following set of functional dependencies:
Σ = {AB → C, B → D, C → A, AD → E }
Give a formal proof (written as a sequence of numbered and appropriately justi- fied derivation steps) that:
(a) Σ l= CB → E (n = 7) [6 marks]
(b) Σ l= AB → EC (n = 8) [6 marks]
Marks are awarded as follows:
● 4 marks for a correct proof that may use the reflexivity, augmentation, trans- itivity, decomposition and union axioms;
● 5 marks if, in addition to the above requirements, the proof does not use the decomposition and union axioms;
● 6 marks if, in addition to the above requirements, the length (that is, number of steps) of the proof is at most n, where n is specified for each point above.
Question 2. Consider the following schedule:
where r denotes a read operation and w denotes a write operation.
(a) Draw the precedence graph of the schedule, and justify the presence of each
edge. [6 marks]
(b) Is the schedule conflict-serializable? Justify your answer, and indicate all of
the serial schedules that are equivalent to the given one (including the case
when there are none). [2 marks]
Question 3. Given a schema consisting of a relation R over attributes A, B, C (in this order) and a relation S over attributes A, B, C, D (in this order), trans- late the following relational calculus query into an equivalent relational algebra expression (on sets):
{ x, x, y, w, z l S(x, y, w, z) A Vu -R(y, w, u) }
You can use AdomN (for any attribute name N) to denote the relational algebra expression that computes the active domain, over attribute N . Only the trans-
lation rules presented in class are allowed. Detail all the steps of the translation. [10 marks]
Question 4. Given a schema consisting of a relation R over attributes A, B, C (in this order), translate the following relational algebra expression (on sets) into an equivalent relational calculus query:
πA,B,C /σA=D^B=E^CF /R x ρASD, B SE, CSF (R)、、
Only the translation rules presented in class are allowed. Detail all the steps of the translation. [8 marks]
Question 5. Assuming set semantics, consider a database schema consisting of relations R over attributes A, B, C (in this order) and S over attributes A, B, C, D (in this order).
(a) Write a Boolean query in Relational Calculus, without universal quantifiers
in its body, that returns true if and only if the functional dependency A, B →
C is satisfied by R. [6 marks]
(b) Write a Relational Algebra query that, using only primitive operations, re-
turns all of the tuples in S for which the inclusion dependency S[B, C] S
R[A, B] is not satisfied. [6 marks]
2021-12-20