GateAI
Relational Algebra

GATE CSE 2014 Set 3 · Q21

MCQ1 markEasy

Time

What is the optimized version of the relation algebra expression πA1(πA2(σF1(σF2(r))))\pi_{A1}(\pi_{A2}(\sigma_{F1}(\sigma_{F2}(r)))), where A1,A2A1, A2 are sets of attributes in rr with A1⊂A2A1 \subset A2 and F1,F2F1, F2 are Boolean expressions based on the attributes in rr?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: A) A1( (F1 ∧ F2)(r))

Relational Algebra

We use standard relational algebra equivalence rules:

  1. Cascade of Selections:

    σF1(σF2(r))≡σF1∧F2(r)\sigma_{F1}(\sigma_{F2}(r)) \equiv \sigma_{F1 \land F2}(r)

    Applying consecutive selection conditions is equivalent to applying a single selection with the logical AND of the conditions.

  2. Cascade of Projections: If A1⊆A2A1 \subseteq A2, then:

    πA1(πA2(E))≡πA1(E)\pi_{A1}(\pi_{A2}(E)) \equiv \pi_{A1}(E)

    Because A1A1 is a subset of A2A2, projecting onto A2A2 first and then onto A1A1 preserves the exact same set of attributes as directly projecting onto A1A1.

Combining these two optimizations gives:

πA1(σ(F1∧F2)(r))\pi_{A1}(\sigma_{(F1 \land F2)}(r))

Thus, option (A) is the correct optimized expression.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Relational Algebra previous year question is Q21 of the GATE CSE 2014 Set 3 paper. Find more GATE CSE PYQs on Relational Algebra in Databases, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 4 related Relational Algebra PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Relational Algebra in GATE CSE

Relational Algebra has 4 GATE CSE PYQs across 4 papers from 2012 to 2024. This is the only 1-mark MCQ among them, and it is the only one in GATE CSE 2014 Set 3.

How GATE tests Relational Algebra

More from GATE CSE 2014 Set 3

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2014 Set 3 · Q21 · MCQ

What is the optimized version of the relation algebra expression A1( A2( F1( F2(r)))), where A1, A2 are sets of attributes in r with A1 ⊂ A2 and F1, F2 are Boolean expressions based on the attributes in r?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.