1. Homepage
  2. Exam
  3. [2022] COMP9315 DBMS Implementation 22T1 - Final Exam - Q7 Relational Algebra

[2022] COMP9315 DBMS Implementation 22T1 - Final Exam - Q7 Relational Algebra

This question has been solved
Engage in a Conversation


Question 7 (10 marks)

Translate the SQL queries below into an efficient sequence of relational algebra operations. Use the notation for relational algebra operations from the Course Notes i.e. CourseNana.COM

When showing complex relational algebra, write it as a sequence of "assignment" statements, with a single relational algebra operation on the right hand side, and a temporary relation to hold the result on the left hand side. The temporary relation can be used in subsequent "assignment" statements. CourseNana.COM

Example: select x,y from R where z = 5; is rendered as: CourseNana.COM

Tmp1 = Sel[z=5] R
Res  = Proj[x,y] Tmp1

Write relational algebra operations for each of these operations on the tables R(a,b,c) and S(c,d) and T(d,e,f,g) CourseNana.COM

  1. select * from S where c = 5 and d = 8
    
  2. select a,d from R join S on R.c = S.c
    
  3. select *
    from   R
    where  c in (select c from S where d = 3)
    
  4. select a,f,g
    from   R join S on (R.c = S.c) join T on (S.d = T.d)
    where  R.b = 2 and S.c = 5 and T.e = 10
    

You do not need to worry about the sizes of tables, intermediate result, projected tuples, number of memory buffers, etc. in answering this question. Treat this as the initial relational algebra transformation stage after parsing the SQL and before query optimisation, and apply the common heuristics used in this phase. CourseNana.COM

State all assumptions. Show all working. CourseNana.COM

Instructions: CourseNana.COM

  • Type your answer to this question into the file called q7.txt
  • Submit via:   give cs9315 exam_q7 q7.txt 
    or via: Webcms3 > exams > Final Exam > Q7 submission > Make Submission
End of Question

Get the Solution to This Question

WeChat WeChat
Whatsapp WhatsApp
COMP9315代写,Database Implementation代写, The University of New South Wales.代写,SQL代写,Relational Algebra代写,COMP9315代编,Database Implementation代编, The University of New South Wales.代编,SQL代编,Relational Algebra代编,COMP9315代考,Database Implementation代考, The University of New South Wales.代考,SQL代考,Relational Algebra代考,COMP9315help,Database Implementationhelp, The University of New South Wales.help,SQLhelp,Relational Algebrahelp,COMP9315作业代写,Database Implementation作业代写, The University of New South Wales.作业代写,SQL作业代写,Relational Algebra作业代写,COMP9315编程代写,Database Implementation编程代写, The University of New South Wales.编程代写,SQL编程代写,Relational Algebra编程代写,COMP9315programming help,Database Implementationprogramming help, The University of New South Wales.programming help,SQLprogramming help,Relational Algebraprogramming help,COMP9315assignment help,Database Implementationassignment help, The University of New South Wales.assignment help,SQLassignment help,Relational Algebraassignment help,COMP9315solution,Database Implementationsolution, The University of New South Wales.solution,SQLsolution,Relational Algebrasolution,