The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+11 votes
1.2k 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 in Databases by Veteran (59.6k points)
edited by | 1.2k views
0
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)
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

 

+1
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 .


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
147,214 comments
62,380 users