Which statement is true regarding transactions? (Choose all that apply.)
A.
A transaction can consist only of a set of DML and DDL statements.
B.
A p art or an entire transaction can be undone by using ROLLBACK command .
C.
A transaction consists of a set of DML or DCL statements.
D.
A part or an entire transaction can be made permanent with a COMMIT.
E.
A transaction can consist of only a set of queries or DML or DDL statements.
C
A transaction consists of a set of DML or DCL statements
Should be
A transaction consists of a set of DML or TCL statements?
DCL – Data Control Language (revoke, grant)
C is incorrect.
Revoke and grant do commit.
The question mentions “A transaction”.
But “Set of DCL statements” is “Multiple transactions” because each DCL contains an implicit commit statement.
At first, I just choose only B.
This question is not clear!
oracle documentation:
Transactions apply only to the Data Manipulation Language (DML) portion of the SQL language (such as INSERT, UPDATE, and DELETE). Transactions do not apply to the Data Control Language (DCL) or Data Definition Language (DDL) portions (such as CREATE, DROP, ALTER, and so on.) of the SQL language. DCL and DDL commands always force a commit, which in turn commits everything done before them.
awiersma, you agree point C is incorrect?
Oracle document says (http://docs.oracle.com/cd/E11882_01/server.112/e10713/transact.htm)
A database transaction consists of one or more statements. Specifically, a transaction consists of one of the following:
•One or more data manipulation language (DML) statements that together constitute an atomic change to the database
•One data definition language (DDL) statement
A transaction has a beginning and an end.
#######################################################################
It will be better if change ‘•One data definition language (DDL) statement
‘ to ‘•One DDL/DCL statement’.
#######################################################################
I don’t think C is a good choice.
C says ‘DCL statements’ – plural. Not one ‘statement’. Not so good…
http://docs.oracle.com/cd/E11882_01/server.112/e10713/transact.htm
From the same documentation:
Structure of a Transaction
A database transaction consists of one or more statements. Specifically, a transaction consists of one of the following:
•One or more data manipulation language (DML) statements that together constitute an atomic change to the database
•One data definition language (DDL) statement
A transaction has a beginning and an end.
so what is the conclusion??
the conlusion is that it is something worng the question. Maybe mistake in answers…
However from documentation: transactions consists of DML and DDL statements so A is correct.
A. The AND makes this statement incorrect. There might not be DDL statement always.
B. We can ROLLBACK entire transaction or Using SAVEPOINT to rollback to certain point. So B is true.
C. DML is true. DCL is true assuming COMMIT, ROLLBACK are also DCL.
D. COMMIT works for entire transaction. False
E. Queries make this statement false.
https://docs.oracle.com/database/121/CNCPT/transact.htm#CNCPT038
A database transaction consists of one or more statements. Specifically, a transaction consists of one of the following:
One or more data manipulation language (DML) statements that together constitute an atomic change to the database
One data definition language (DDL) statement
B and D are correct !!!