Converting SQL to Relational Algebra Example
<p>I wrote this SQL statement and want to figure out its relational algebra:</p>

<pre><code>SELECT S.Oid
FROM Shipment S
WHERE EXISTS (SELECT W.Wid
FROM Warehouse W
WHERE W.City = ‘Pittsburgh’ AND S.Wid = W.Wid)
</code></pre>

<p>Is this the correct relational algebra for the statement?</p>

<blockquote>
  <p>(π S.Oid (Shipment S)) U (π W.City = ‘Pittsburgh’, S.Wid = W.Wid
  (Warehouse W))</p>
</blockquote>