41 41 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$? $R_1 \cup R_2$ $R_1 \times R_2$ $R_1 – R_2$ $R_1 \cap R_2$ Databases gate1998 normal relational-algebra + – Kathleen 13.3k views answer comment Share Follow Print See all 2 Comments 2 2 Comments reply Deepak Poonia commented Aug 26, 2024 i edited by Deepak Poonia Aug 26, 2024 reply Follow flag Detailed Video Solution: https://youtu.be/H4-GIPOm2DE?feature=sharedNOTE that the given "join" operation is Equi-Join, & hence the Schema of the result will be $(A,B,C,D)$, So, technically, no option is correct.BUT Authors like Raghu Ramakrishnan project only one attribute from the equated attributes in Equijoin.The schema of given Equijoin operation, as per Navathe & Ullman, will be $(A,B,C,D).$The schema of given Equijoin operation, as per Raghu Ramakrishnan, will be $(A,B).$Neverthless, Option D is the best choice. Watch the Video Solution above. 26 26 replyShare js__ commented Dec 13, 2025 reply Follow flag taking small examples can help :A B C D1 2 5 92 3 2 34 3 3 15 1 8 4given expr will return (2 3) 0 0 replyShare Please log in or register to add a comment.
Best answer 61 61 votes This question is an example of Theta Join, $r \bowtie_\theta s= \sigma_\theta(r \times s)$ The join here will be selecting only those tuples where $A = C$ and $B = D,$ meaning it is the intersection. D option. Arjun answered Jan 23, 2016 • edited Oct 22, 2017 Arjun comment Share Follow See all 21 Comments 21 21 Comments reply daksirp commented Aug 17, 2018 reply Follow flag so, what will be the attributes of resultant table : (A B) or (C D) ?? 1 1 replyShare Verma Ashish commented Aug 17, 2018 reply Follow flag in natural join common attributes are removed. Here all attributes are present only those tuples where A = C and B = D 4 4 replyShare daksirp commented Aug 17, 2018 reply Follow flag didnt get you exactly, are you saying " all attributes will be present in resultant table " i,e (A B C D) ?? 1 1 replyShare Verma Ashish commented Aug 17, 2018 reply Follow flag Yes. 2 2 replyShare daksirp commented Aug 17, 2018 reply Follow flag if that is the case, then Option D will not be correct . In R1 ∩ 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 1 replyShare Ayush Upadhyaya commented Oct 5, 2018 reply Follow flag 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$ 6 6 replyShare daksirp commented Oct 5, 2018 reply Follow flag Option A & Option B will be eliminated. but option 'C' is also Empty set . 0 0 replyShare Harshada commented Jan 10, 2019 reply Follow flag @daksirp R1-R2 will give all the tuples of R1 for given example and not an empty set. 1 1 replyShare daksirp commented Jan 10, 2019 reply Follow flag yaa, mistake. tx for correcting. 0 0 replyShare Venky8 commented May 5, 2021 reply Follow flag Isn’t it an example of equi-join? I’m confused please clarify. 0 0 replyShare sauravgahlawat commented Jun 6, 2021 reply Follow flag @Venky8 Question above has conditional join (or theta join) which will result in all the tuples which satisfies the condition A=C ^ B=D and the resulting relation will have the schema R(A, B, C, D) i.e, above conditional join is equivalent to σ(A=C ^ B=D)(R1 X R2) 0 0 replyShare Venky8 commented Jun 7, 2021 reply Follow flag @sauravgahlawat Yes, that is indeed true but I was curious whether the query in question was also an example of equi-join. An equijoin is a theta join using the equality operator. See Source. So above query is example of both theta-join and equi-join. 0 0 replyShare sauravgahlawat commented Jun 7, 2021 reply Follow flag @Venky8 Okay, but can we use two equality operator in equijoin? shouldn’t it be like: R1 equijoin (A = C) R2 intersection R1 equijoin(B=D) R2 0 0 replyShare Venky8 commented Jun 7, 2021 reply Follow flag An equijoin is just a theta join with only an equality operator. Whereas, a non-equijoin use joins with operators other than equality operators like <, >, >=, etc. So of course we can use more than one equality operator in equijoin just like it is used in the query given in the question. There is no equijoin operator neither in relational algebra nor SQL. Equijoin is just a type of join, which is theoretical. Your idea is right. Just correcting your relational algebra query: $R1 \Join _{A = C} R2 \; \bigcap \; R1 \Join _{B = D} R2$ 0 0 replyShare sauravgahlawat commented Jun 7, 2021 reply Follow flag Okay got it. Also I don’t know where are the correct symbols for joins :( Appreciate the correction 1 1 replyShare Venky8 commented Jun 7, 2021 reply Follow flag $R1 \Join_{c} R2$ is the general join operation with condition predicate c on the columns of R1 and R2. Left outer join: R1 ⟕$_{c}$ R2 Right outer join: R1 ⟖$_{c}$ R2 Full outer join: R1 ⟗$_{c}$ R2 $R1 \Join R2$ is natural join without any condition specified. The columns having the same name will be merged. 2 2 replyShare Sri28 commented Jan 10, 2025 reply Follow flag From Union Compatible,we can't say that R1 U R2 means option A although there is a equi join? 0 0 replyShare jacknroll commented Aug 29, 2025 reply Follow flag isnot join operations gives us schema which takes attribute of both table here (ABCD) is the schema right? 0 0 replyShare camelCase.ai commented Dec 19, 2025 reply Follow flag . 0 0 replyShare camelCase.ai commented Dec 19, 2025 reply Follow flag Right ABCD will be the final schema here 0 0 replyShare Ysh 1 commented Sep 4 reply Follow flag The question can be equally transformed to : r1(ab) natural join r2(ab) with renaming cd 0 0 replyShare Please log in or register to add a comment.
1 1 vote ✍️ Example:Let’s say:R₁(A, B):AB123456R₂(C, D):CD345678🔗 Operation: R₁ ⋈A₌C ∧ B₌D R₂We match rows where:A = CB = DSo we look for tuples that are identical in both tables.✅ Matching tuples:⟨3, 4⟩⟨5, 6⟩🎯 Result:ABCD34345656This is just the intersection of R₁ and R₂. Ujjwal_Nikam answered Oct 29, 2025 Ujjwal_Nikam comment Share Follow 0 reply Please log in or register to add a comment.