title: What is the difference between Non-Repeatable Read and Phantom Read?
body: <p>What is the difference between <strong>non-repeatable read</strong> and <strong>phantom read</strong>?</p>
  <p>I have read the <a href="http://en.wikipedia.org/wiki/Isolation_(database_systems)" rel="nofollow noreferrer">Isolation (database systems) article from Wikipedia</a>, but I have a few doubts. In the below example, what will happen: the <strong>non-repeatable read</strong> and <strong>phantom read</strong>?</p>
  <p>####<strong>Transaction A</strong></p>
  <pre><code>SELECT ID, USERNAME, accountno, amount FROM USERS WHERE ID=1
  </code></pre>
  <p>####<strong>OUTPUT:</strong></p>
  <pre><code>1----MIKE------29019892---------5000
  </code></pre>
  <p>####<strong>Transaction B</strong></p>
  <pre><code>UPDATE USERS SET amount=amount+5000 where ID=1 AND accountno=29019892;
  COMMIT;
  </code></pre>
  <p>####<strong>Transaction A</strong></p>
  <pre><code>SELECT ID, USERNAME, accountno, amount FROM USERS WHERE ID=1
  </code></pre>
  <p>Another doubt is, in the above example, which isolation level should be used? And why?</p>