title: insert and update if a record exists else not , race condition
body: <pre><code>if exists (select itemcode from item where itemcode=1120)
  update item 
  set itemname = 'laptop'
  where itemcode = 1120
  
  else 
  insert into item (itemcode,itemname)
  values (1120,'laptop')
  </code></pre>
  
  <p>it will be used by multiple users. will this query give a race condition.
  if yes, then how?what shall i use in place of this query?</p>