Which two statements complete a transaction? (Choose two.)
-
DELETE employees;
-
DESCRIBE employees;
-
ROLLBACK TO SAVEPOINT C;
-
ALTER TABLE employees SET UNUSED COLUMN sal;
-
GRANT SELECT ON employees TO SCOTT;
In Oracle, DDL statements like ALTER TABLE and DCL statements like GRANT issue an implicit COMMIT, thereby completing the current transaction. ROLLBACK TO SAVEPOINT does not end a transaction; it only reverts to a specific point within it.
To complete a transaction, there are typically two statements involved: COMMIT and ROLLBACK.
Let's go through each option to determine which two statements complete a transaction:
A. DELETE employees; This statement is used to delete data from a table but does not complete a transaction.
B. DESCRIBE employees; This statement is used to describe the structure of a table but does not complete a transaction.
C. ROLLBACK TO SAVEPOINT C; This statement is used to rollback a transaction to a specific savepoint, effectively undoing all changes made after that savepoint. This is one of the statements that completes a transaction.
D. ALTER TABLE employees SET UNUSED COLUMN sal; This statement is used to mark a column as unused in a table, but it does not complete a transaction.
E. GRANT SELECT ON employees TO SCOTT; This statement is used to grant select privileges on a table to a user, but it does not complete a transaction.
Based on the above analysis, the two statements that complete a transaction are:
C. ROLLBACK TO SAVEPOINT C; D. ALTER TABLE employees SET UNUSED COLUMN sal;
Therefore, the correct answer is C and D.