Loading

Quipoin Menu

Learn • Practice • Grow

sql / SQL Transactions
mcq
Direction: Choose the correct option

Q1.

What is a transaction in SQL?
A. View definition
B. Single query
C. Unit of work with multiple operations
D. Table operation
Direction: Choose the correct option

Q2.

START TRANSACTION; INSERT INTO accounts VALUES (1,1000); INSERT INTO accounts VALUES (2,500); COMMIT;
What does COMMIT do?
A. Undoes changes
B. Ends transaction
C. Pauses transaction
D. Saves changes permanently
Direction: Choose the correct option

Q3.

START TRANSACTION; INSERT INTO accounts VALUES (3,200); ROLLBACK;
What happens after ROLLBACK?
A. Transaction continues
B. Insert is saved
C. Error occurs
D. Insert is undone
Direction: Choose the correct option

Q4.

START TRANSACTION; INSERT INTO accounts VALUES (4,300); SAVEPOINT sp1; INSERT INTO accounts VALUES (5,400); ROLLBACK TO sp1; COMMIT;
Which insert is kept?
A. Both inserts
B. Only (5,400)
C. Neither
D. Only (4,300)
Direction: Choose the correct option

Q5.

What is autocommit mode?
A. No commits allowed
B. Each statement is auto-committed
C. Manual commits only
D. Only in MySQL