Posted on:

28 Jun 2021

1

Commit and Rollback Lecture Query.

Hello team,
I had a doubt in the Update statment lecutre.
I executed the following code

DROP TABLE dep_duplicate;

CREATE TABLE dep_duplicate
(
department_no CHAR(4) NOT NULL,
dept_name VARCHAR(40) NOT NULL
);

INSERT INTO dep_duplicate
(
department_no,
dept_name
)
SELECT *
FROM departments;

SELECT *
FROM dep_duplicate;

COMMIT;

UPDATE dep_duplicate
SET
department_no = 'd001',
dept_name = 'ABC';

ROLLBACK;

However after ROLLBACK still I see the updated records only, not the original dep_duplicate table created from the depratments table.

I am not understanding why is that happening, an explaination will be helpful.
Thank you.

0 answers ( 0 marked as helpful)

Submit an answer