in unrepeatable read one transaction reads two different values .
T1 |
T2 |
R(x) //initial x=100 |
|
|
W(x) x=x+100 |
R(x) //x=200. |
|
Here transaction T1 read having two values,this is unrepeatable read.
In phantom read same as unrepeatable read one difference is value not exists or new values inserted in between when more than one time transaction executes.
T1 |
T2 |
R(x) // x=100 |
|
|
R(x) // x=100 |
delete(x) |
|
|
R(x) // not exists. |
or simple query
T1=select * from employee where rank>100
T2=insert into employee(A,120)
Transaction B inserts a row that would satisfy the query in Transaction A if it were issued again.