<p>As said in Wikipedia (<a href="http://en.wikipedia.org/wiki/Relational_algebra#Natural_join_.28.E2.8B.88.29" rel="nofollow">http://en.wikipedia.org/wiki/Relational_algebra#Natural_join_.28.E2.8B.88.29</a>), natural join $X \bowtie Y$ contains unions of pairs $x \in X$, $y \in Y$ which have $X$'s and $Y$'s all common attributes equal. </p>

<p>So, in your case, natural join would consist of only one tuple $\{ \langle A = 1, B = 2, C = 3, D = 4 \rangle \}$</p>

CC BY-SA 3.0
2013-05-07T22:20:35.100Z
2013-05-07T22:20:35.100Z
Andrey Komarov
<p>So I got two relations with two common attributes. For one of those attributes, the attribute values in two of the tuples of those relations are the same, for the other they aren't.<br>
How does my result after a natural join look like?</p>

<p>Example:<br>
<strong>A B C&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;B C D</strong><br>
1 2 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2 3 4<br>
5 6 7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6 8 9<br>
I would join the first tuples of both relations, since there's 2/3 in both of them. What about the second tuples? There's 6/7 on the left, and 6/8 on the right.</p>

CC BY-SA 3.0
2013-05-07T22:20:41.660Z
this is out of scope for this site. Maybe it's better off on cs.SE. this site is for **research**-level questions.
Suresh Venkat
<db.databases>
Relational Algebra - Natural Join
ab cd
# Relational Algebra - Natural Join

(Asked by: username_0 on 2013-05-07)

So I got two relations with two common attributes. For one of those attributes, the attribute values in two of the tuples of those relations are the same, for the other they aren't.  
How does my result after a natural join look like?

Example:  
**A B C     B C D**  
1 2 3     2 3 4  
5 6 7     6 8 9  
I would join the first tuples of both relations, since there's 2/3 in both of them. What about the second tuples? There's 6/7 on the left, and 6/8 on the right.

**Tags:** db.databases
> **Comments:**
> **username_1**: this is out of scope for this site. Maybe it's better off on cs.SE. this site is for **research**-level questions.  

---

## 1 answers

### Answer by username_2 on 2013-05-07. Score: -1 | Accepted answer

As said in Wikipedia (<http://en.wikipedia.org/wiki/Relational_algebra#Natural_join_.28.E2.8B.88.29>), natural join $X \bowtie Y$ contains unions of pairs $x \in X$, $y \in Y$ which have $X$'s and $Y$'s all common attributes equal.

So, in your case, natural join would consist of only one tuple $\{ \langle A = 1, B = 2, C = 3, D = 4 \rangle \}$


---

