23 votes 23 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 asked Sep 25, 2014 edited Feb 5, 2018 by go_editor Kathleen 7.2k views answer comment Share Follow See 1 comment See all 1 1 comment reply dhingrak commented Jan 19, 2015 reply Follow Share Please explain 0 votes 0 votes Please log in or register to add a comment.
Best answer 41 votes 41 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 16 Comments See all 16 16 Comments reply Show 13 previous comments Venky8 commented Jun 7, 2021 reply Follow Share 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 votes 0 votes sauravgahlawat commented Jun 7, 2021 reply Follow Share Okay got it. Also I don’t know where are the correct symbols for joins :( Appreciate the correction 1 votes 1 votes Venky8 commented Jun 7, 2021 reply Follow Share $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 votes 2 votes Please log in or register to add a comment.