+12 votes
1.5k views

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
edited | 1.5k views
0
Please explain

## 1 Answer

+26 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 (407k points)
edited
0
so, what will be the attributes of resultant table :

(A B) or (C D) ??
0

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

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

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 : https://gateoverflow.in/234092/equi_joins?show=234161#c234161

+2
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$
0
Option A & Option B will be eliminated.

but option 'C' is also Empty set .
0

@daksirp R1-R2 will give all the tuples of R1 for given example and not an empty set.

0
yaa, mistake. tx for correcting.
Answer:

+20 votes
13 answers
1
+24 votes
1 answer
2
+14 votes
3 answers
3
+16 votes
3 answers
4
+10 votes
1 answer
5
+16 votes
3 answers
6
+17 votes
5 answers
7