title: Compute theta join in relational algebra
body: <p>I`m having trouble with this problem:</p>
  
  <p>Suppose relation R(A,B) has the following tuples:</p>
  
  <pre><code>A   B
  1   2
  3   4
  5   6
  </code></pre>
  
  <p>and relation S(B,C,D) has the following tuples:</p>
  
  <pre><code>B   C   D
  2   4   6
  4   6   8
  4   7   9
  </code></pre>
  
  <p>Compute the theta-join of R and S with the condition R.A &lt; S.C AND R.B &lt; S.D. Which of the following tuples is in the result? Assume each tuple has schema (A, R.B, S.B, C, D).</p>
  
  <p>Choose from the following answers:</p>
  
  <pre><code>(3,4,2,4,6)
  (1,2,4,4,6)
  (1,2,2,6,8)
  (3,4,4,7,8)
  </code></pre>
  
  <p>So when I try it, I see that </p>
  
  <pre><code>(1, 2) matches (2, 4, 6)
  (3, 4) matches (4, 6, 8)
  (3, 4) matches (4, 7, 9)
  </code></pre>
  
  <p>so I found the following tuples (they all respect the condition):</p>
  
  <pre><code>(1, 2, 2, 4, 6)
  (3, 4, 4, 6, 8)
  (3, 4, 4, 7, 9)
  </code></pre>
  
  <p>The problem is that none of these are found in the multiple choices...</p>
  
  <p>Am I doing something wrong?</p>
  
  <p>Thanks for the help!</p>