The SQL statements executed in a user session as follows: create table product(pid int(10),pname varchar(10)); Insert into product values(1,'pendrive'); Insert into product values(2,'harddisk'); savepoint a; update product set pid=20 where pid=1; savepoint b; delete from product where pid=2; commit; delete from product where pid=10; Which statements describe the consequence of issuing the ROLLBACK TO SAVE POINT a command in the session?
Answer options
A
The table contains: p1-pen, p2-pencil (rows before the savepoint are kept).
B
The table is empty (all rows are rolled back).
C
The table contains: p1-pen, p2-pencil, p3-eraser (all rows retained).
D
An error is raised because savepoint names must be unique.
Correct answer: The table contains: p1-pen, p2-pencil (rows before the savepoint are kept).
Explanation
ROLLBACK TO SAVEPOINT sp1 undoes changes after the savepoint, so only p3-eraser is removed. p1 and p2 remain.