Multiple choice technology databases

Which two statements complete a transaction? (Choose two.)

  1. DELETE employees;

  2. DESCRIBE employees;

  3. ROLLBACK TO SAVEPOINT C;

  4. ALTER TABLE employees SET UNUSED COLUMN sal;

  5. GRANT SELECT ON employees TO SCOTT;

Reveal answer Fill a bubble to check yourself
C,D Correct answer
Explanation

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.

AI explanation

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.