Last answered:

29 May 2024

Posted on:

13 Jan 2023

2

ROLLBACK execution!

In the video example, we changed the last_name from 'Winnfield' to 'Johnson' using the UPDATE statement and then used a COMMIT statement.
When we used a ROLLBACK statement, the video showed the last_name getting changed back to Winnfield.

Now my confusion is:
Later in the video, you defined ROLLBACK as the statement which reverts the changes back to the last non-committed state and in my opinion, the video shows the changes getting reverted back to the last committed state.

So I think the ROLLBACK statement shouldn't be able to revert back to 'Winfield'. So, one of us is wrong so please clarify.
image

2 answers ( 0 marked as helpful)
Posted on:

07 Sept 2023

1

I think you are right. It should stay as Johnson instead of reverting back to Winnfield since the change to Johnson was followed by a COMMIT.

Instructor
Posted on:

29 May 2024

0

Hi Aniruddha and Naveen!
Thanks for reaching out.


@: Naveen
Thanks for sharing this piece of information with the Community!


@: Aniruddha 

ROLLBACK is a statement which reverts the changes back to the last committed state. So, it should return Johnson.


Hope this helps.
Best,
Tsvetelin

Submit an answer