Sql Interview question #1 : What is a dirty read?


Question

What is a dirty read?

Answer

A dirty read occurs when two operations, say, READ and WRITE occur together giving the incorrect or intermediate data. Suppose, User1 changed a row but did not commit the changes and User2 then reads the uncommitted data. The data may be wrong if User 2 does a rollback because the intermediate data may never have been committed.

Because data in the intermediate state may never have been committed, it is considered a dirty read.

 

Thanks for reading this article,

Next

  1. Share this with your colleagues because Sharing is Learning
  2. Comment below if you need any assistance