The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+11 votes

Given two union compatible relations $R_1(A, B)$ and $R_2 (C, D)$, what is the result of the operation $R_1 \Join_{ A = C \wedge B = D} R_2$?

  1. $R_1 \cup R_2$

  2. $R_1 \times R_2$

  3. $R_1 – R_2$

  4. $R_1 \cap R_2$

asked in Databases by Veteran (59.6k points)
edited by | 1.2k views
Please explain

1 Answer

+23 votes
Best answer

This question is an example of Theta Join,


The join here will be selecting only those tuples where A = C and B = D, meaning it is the intersection. D option.

answered by Veteran (359k points)
so, what will be the attributes of resultant table :

(A B) or (C D) ??

in natural join common attributes are removed. Here all attributes are present

only those tuples where A = C and B = D
didnt get you exactly, are you saying " all attributes will be present in resultant table " i,e (A B C D) ??

if that is the case, then Option D will not be correct . 

In R∩ R2

All (A B C D) will not be there in resultant table, only two attributes should be there in intersection.

Check @Arjun Sirs answer. and this answer of @Shaik Masthan :


Take a small example and see which one goes correct

For $R_1$ take tuples (1,2),(3,1),(1,6) and (7,9)

For $R_2$ take tuples (3,6),(4,8),(9,2)

The result of given RA query comes to be empty and this is equivalent to if we take the intersection of $R_1$ and $R_2$
Option A & Option B will be eliminated.

but option 'C' is also Empty set .

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

41,055 questions
47,653 answers
62,380 users