title: relational algebra to SQL
body: <p>Having this schema :</p>
  
  <pre><code>Doctor(license_no, doctor_name, specialty)
  
  Patient(pat_id, pat_name, pat_address, pat_phone, date_of_birth)
  
  Visit(license_no, pat_id, date_of_visit, type, diagnosis, charge) 
  </code></pre>
  
  <p>I have to translate <code>Patient (join sign) pat_id(date&gt;=1-1-2005^ date&lt;1-1-2006(Visit))</code>
  and I thought it means to select patients who visited a doctor between 1/1/2005 and 1/1/2006 so I made this query:</p>
  
  <pre><code>SELECT p.pat_ID FROM Patient p INNER JOIN Visit v 
  ON (p.pat_ID = v.pat_ID)
  WHERE date_of_visit &lt;= '01-01-2005' AND date_of_visit &lt; '01-01-2006'
  </code></pre>
  
  <p>Does the relational algebra statement mean what I thought and the SQL query returns the right result?</p>