GATE / CS ARCHIVE

GATE CSE 2001 / QUESTION 1.25

Pushing a selection through a join

Database Management Systems · Relational Algebra & Calculus · Full GATE CSE 2001 paper

GATE 2001, Q1.25 1 mark · MCQ
Report issue

Relational Algebra & Calculus

Question 1.25, GATE 2001: For relations r and s with A an attribute of r, simplify σ_(A=a)(r⋈s). Choices are σ_(A=a)(r), r, σ_(A=a)(r)⋈s, or none.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Step 1: The predicate A=a refers only to an attribute of r. A joined tuple survives the selection exactly when its r component has that value.

Step 2: Rejecting the failing r tuples before joining therefore removes exactly the same joined tuples: σ_(A=a)(r⋈s)=σ_(A=a)(r)⋈s. This is C.

Dropping s altogether can lose its attributes and its filtering effect, so neither r nor its selected subset alone is generally equal to the joined result.

Original paper, page 3