title: Update record in a table where the condition depends on other table
body: <p>I have 2 table in MySQL</p>
  
  <ul>
  <li><p>Project:<pre><code>
  ProjectID         ProjectStatus
      1                    0
      2                    0
      3                    0
      4                    0
      5                    0
  </code></pre></p></li>
  <li><p>Quotation:<pre><code>
  QuotationID         ProjectID            QuotationNumber
      1                    1                     X001
      2                    2                     X002
      3                    3                     X003
      4                    1                     X004
      5                    2                     X005
  </code></pre></p></li>
  </ul>
  
  <p>I need a SQL Syntax which can update or edit ProjectStatus in table Project  </p>
  
  <p>if the project is in the quotation table then change ProjectStatus to 1
  if the project is NOT in the quotation table then change ProjectStatus to 2</p>
  
  <p>So after i runt that SQL syntax, the Project table will become like this:</p>
  
  <ul>
  <li>Project(After Query Run):<pre><code>
  ProjectID         ProjectStatus
      1                    1
      2                    1
      3                    1
      4                    2
      5                    2
  </code></pre></li>
  </ul>
  
  <p>I tried many queries, but i cant figure it out. </p>
  
  <p>Anyone  can help please. </p>
  
  <p>Thank you for your help.</p>