GateAI
Relational Algebra

GATE CSE 2012 · Q50

MCQ2 marksMedium

Time

Common Data for Questions 50 and 51

Consider the following relations AA, BB and CC: How many tuples does the result of the following relational algebra expression contain? Assume that the schema of A∪BA \cup B is the same as that of AA. (A∪B)⋈A.Id>40∨C.Id<15C(A \cup B) \bowtie_{A.\text{Id} > 40 \lor C.\text{Id} < 15} C

GATE CSE 2012 Q50 diagram

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: A) 7

Relational Algebra
  1. Find A∪BA \cup B: Relational algebra operations work on sets, so duplicates are eliminated.

    • Tuples in AA: (12,Arun,60)(12, \text{Arun}, 60), (15,Shreya,24)(15, \text{Shreya}, 24), (99,Rohit,11)(99, \text{Rohit}, 11)

    • Tuples in BB: (15,Shreya,24)(15, \text{Shreya}, 24), (25,Hari,40)(25, \text{Hari}, 40), (98,Rohit,20)(98, \text{Rohit}, 20), (99,Rohit,11)(99, \text{Rohit}, 11)

    • Set union A∪BA \cup B contains 55 unique tuples:

      1. (12,Arun,60)(12, \text{Arun}, 60)

      2. (15,Shreya,24)(15, \text{Shreya}, 24)

      3. (25,Hari,40)(25, \text{Hari}, 40)

      4. (98,Rohit,20)(98, \text{Rohit}, 20)

      5. (99,Rohit,11)(99, \text{Rohit}, 11)

  2. Tuples in CC:

    • (10,2200,02)(10, 2200, 02)

    • (99,2100,01)(99, 2100, 01)

    Total 22 tuples.

  3. Evaluate the Theta-Join Condition (A.Id>40∨C.Id<15)(A.\text{Id} > 40 \lor C.\text{Id} < 15):

    • For tuple with C.Id=10C.\text{Id} = 10 in CC: Since C.Id=10<15C.\text{Id} = 10 < 15 is true, the OR condition is satisfied for all 55 tuples of A∪BA \cup B. (Yields 55 tuples)

    • For tuple with C.Id=99C.\text{Id} = 99 in CC: Here C.Id<15C.\text{Id} < 15 is false, so we need A.Id>40A.\text{Id} > 40. The tuples from A∪BA \cup B satisfying this are (98,Rohit,20)(98, \text{Rohit}, 20) and (99,Rohit,11)(99, \text{Rohit}, 11). (Yields 22 tuples)

  4. Total tuples in the result:

    5+2=75 + 2 = 7

Hence, the correct option is (A).

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 Q50 of the GATE CSE 2012 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. 2 of them are 2-mark MCQs like this one, and it is the only one in GATE CSE 2012.

How GATE tests Relational Algebra

More from GATE CSE 2012

Share this solution

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

GateAI solution cardGATE CSE 2012 · Q50 · MCQ

Common Data for Questions 50 and 51: Consider the following relations A, B and C: How many tuples does the result of the following relational algebra expression contain? Assume that the schema of A ∪ B is the same as that of A. (A ∪ B) A.Id > 40 ∨ C.Id < 15 C

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.