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$

edited | 1.5k views
0

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.

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.

1
2