title: Can someone explain me how the cartesian product works in relational algebra
body: <p><a href="http://en.wikipedia.org/wiki/Relational_algebra#Selection_and_cross_product" rel="noreferrer">here</a> it says</p>
  
  <p>Selection and cross product</p>
  
  <p>Cross product is the costliest operator to evaluate. If the input relations have N and M rows, the result will contain NM rows. Therefore it is very important to do our best to decrease the size of both operands before applying the cross product operator.</p>
  
  <p>suppose that we have 2 relations</p>
  
  <p>first relation is called Student and has 3 attributes, thus</p>
  
  <pre><code>    student
    |a |b   |c |
    ------------
    |__|___|___|
    |__|___|___|
    |__|___|___|
  </code></pre>
  
  <p>second relation is university and again with 3 attributes</p>
  
  <pre><code>   university
    |e |f   |g |
    ------------
    |__|___|___|
    |__|___|___|
    |__|___|___|
  </code></pre>
  
  <p>we have 3 rows for each relation, so after applying the cross product operation we will get a relation which has 3*3 = 9 rows</p>
  
  <p>now, I don't understand, why 9 and not 3?</p>
  
  <p>won't the final relation be</p>
  
  <pre><code> final relation
   |a |b   |c |d |e   |f |g |
   --------------------------
   |__|___|___|__|____|__|__|
   |__|___|___|__|____|__|__|
   |__|___|___|__|____|__|__|
  </code></pre>
  
  <p>doesn't this have 3 rows again? </p>
  
  <p>Thanks</p>