COMP3311 Final Exam 20T3 The University of New South Wales
COMP3311 Database Systems
Final Exam 20T3
Database Systems
[Front Page] [Notes] [Database] [Course Website] [Cheat Sheets]
[Q1] [Q2] [Q3] [Q4] [Q5] [Q6] [Q7] [Q8] [Q9] [Q10] [Q11] [Q12]

Question 11 (9 marks)

Assume that we have a collection of relations as follows:

R(a,b,c)   S(d,e)   T(a,d,f)

Write relational algebra equivalents of the following SQL statements. You may write multiple steps, with one RA operation in each step. Use the notation which has implicit projections and renaming by writing attribute names on the left-hand side of the "assignment", e.g.

 Tmp1(a,b) = Sel[c=5]R 

rather than

Tmp = Rename[R→Tmp](Proj[a,b](Sel[c=5]R)) 

The final step should produce a relation called Res.

Exercises:

  1. select * from R;
    
  2. select a,b from R where c < 0;
    

  3. select a,d from R join S on (b = e) where c < 0;
    

  4. select b,c,e,f from R natural join T natural join S;
    

Instructions:

End of Question