Professional Documents
Culture Documents
For each of the following questions, formulate the specified queries in relational algebra. DO NOT
use the Cartesian product operator in any of these expressions. Also, explain the logic behind your
solutions in brief (your answers would not be evaluated if you have not mentioned the logic).
a) Retrieve the name of each actor together with the titles of the films he/she has performed in.
b) Find out the names of all actors that have played the character of ‘Bruce Wayne’.
c) Retrieve the details of all actors that appeared in ‘Inception’.
[3 X 2 = 6 Marks]
Q.2 Let R = (A,B,C), and let 𝑟1 and 𝑟2 both be relations on schema R. Give an expression in SQL that is
equivalent to each of the following queries.
a) 𝑟1 ⋃ 𝑟2
b) 𝑟1 ⋂ 𝑟2
c) 𝑟1 − 𝑟2
d) 𝛱𝐴,𝐶 (𝑟1 ) ⋈ 𝛱𝐴,𝐶 (𝑟2)
[4 Marks]
Q. 4 The following relation schema can be used to register information on the repayments on loans.
A borrower is identified with a unique borrower_id, and has only one address. Borrowers can have
multiple simultaneous loans, but they always have different request dates. The borrower can make
multiple repayments on the same day, but not more than one repayment per loan per day.
a) Derive the set of functional dependencies (from the given information).
b) State a candidate key for Repayment.
c) Make the schema normalization up to BCNF. Show all the intermediate steps.
[3+2+5 = 10 Marks]