Which statement describes the consequences?

Given below are the SQL statements executed in a user session:
CREATE TABLE product
(pcode NUMBER(2),
pname VARCHAR2(10));
INSERT INTO product VALUES(1, ‘pen’);
INSERT INTO product VALUES (2,’pencil’);
SAVEPOINT a;
UPDATE product SET pcode = 10 WHERE pcode = 1;
SAVEPOINT b;
DELETE FROM product WHERE pcode = 2;
COMMIT;
DELETE FROM product WHERE pcode=10;
ROLLBACK TO SAVEPOINT a;
Which statement describes the consequences?

Given below are the SQL statements executed in a user session:
CREATE TABLE product
(pcode NUMBER(2),
pname VARCHAR2(10));
INSERT INTO product VALUES(1, ‘pen’);
INSERT INTO product VALUES (2,’pencil’);
SAVEPOINT a;
UPDATE product SET pcode = 10 WHERE pcode = 1;
SAVEPOINT b;
DELETE FROM product WHERE pcode = 2;
COMMIT;
DELETE FROM product WHERE pcode=10;
ROLLBACK TO SAVEPOINT a;

Which statement describes the consequences?

A.
No SQL statement would be rolled back.

B.
Both the DELETE statements would be rolled back.

C.
Only the second DELETE statement would be rolled back.

D.
Both the DELETE statements and the UPDATE statement would be rolled back.



Leave a Reply 1

Your email address will not be published. Required fields are marked *


Bagdad

Bagdad

A commit erases all previous savepoints!