Let r and s be two relations over the relation schemes R and S respectively,…

2001

Let r and s be two relations over the relation schemes R and S respectively, and let A be an attribute in R. then the relational algebra expression

GATECS200Q25B

is always equal to

GATECS200Q25
  1. A.

    A

  2. B.

    B

  3. C.

    C

  4. D.

    D

Attempted by 59 students.

Show answer & explanation

Correct answer: C

  • A tuple t is in the final result of σ (A=a)(r s) if and only if it is a combination of a tuple from r and a tuple from s that match on common attributes, and the component from r satisfies A=a.

  • Filtering r beforehand removes exactly those tuples that would have been discarded anyway after the join.

Query Optimization Insight: In real-world databases, evaluating option (c) is vastly more efficient than evaluating the original expression. Joining two large tables first and then filtering takes a lot of memory and time. Filtering the table r first significantly reduces the number of rows that participate in the join operation.

Explore the full course: Gate Guidance By Sanchit Sir