title: Count in Relational Algebra
body: <p>I need to query the number of apartments where all rental contract are signed by occupants from the same nationality </p>
  
  <p>I tried something like this: </p>
  
  <pre><code>π numberapartments
  y nationality; numberapartments&lt;--Count(a_id)
  </code></pre>
  
  <p>And I also need some joins somewhere, I don't know. </p>
  
  <p>How could I do this query? </p>
  
  <p>Thanks. </p>
  
  <p><a href="https://i.stack.imgur.com/E1jbX.png" rel="nofollow noreferrer">You can find the schema here</a></p>