title: Difference between "IF EXISTS" and "IF NOT EXISTS" in SQL?
body: <p>I am very new to SQL. I want to know what happens when i use "IF EXISTS" or "IF NOT EXISTS". 
  For ex: what is the difference between the following two statements:</p>
  
  <h2>Statement 1: <em>(EXISTS)</em></h2>
  
  <pre><code>IF EXISTS( SELECT ORDER_ID FROM DBO.ORDER_DETAILS WHERE ORDER_ID = 11032 )
  BEGIN
       DELETE FROM DBO.ORDER_DETAILS WHERE ORDER_ID = 11032
  END
  </code></pre>
  
  <h2>Statement 2: <em>(NOT EXISTS)</em></h2>
  
  <pre><code>IF NOT EXISTS( SELECT ORDER_ID FROM DBO.ORDER_DETAILS WHERE ORDER_ID = 11032 )
  BEGIN
       DELETE FROM DBO.ORDER_DETAILS WHERE ORDER_ID = 11032
  END
  </code></pre>
  
  <p>What will the <code>IF EXISTS</code> or <code>IF NOT EXISTS</code> return? 
  Which is better among these both?
  When to use <code>IF EXISTS</code> and when to use <code>IF NOT EXISTS</code></p>