Which of the following commands cannot be rolled back?

Which of the following commands cannot be rolled back? Each correct answer represents a complete solution.
Choose two.

Which of the following commands cannot be rolled back? Each correct answer represents a complete solution.
Choose two.

A.
DELETE

B.
TRUNCATE

C.
UPDATE

D.
COMMIT

Explanation:
Answer D and BCOMMIT statement is a transaction control statementthat ends the current database transaction and makes
all changes made in that
transaction permanent. It also releases all locks on the transaction. The TRUNCATE statement is a Data
Definition Language (DDL) statement that is used toremove all records from a table. It also releases the
storage space used by the table. The TRUNCATE statement cannot be rolled back.
Syntax:
TRUNCATE TABLE TableName;
Therefore, both the commands, COMMIT and TRUNCATE, can never be rolled back. Note: The TRUNCATE
command includes a built-in COMMIT command. Answer C and A are incorrect. The SQL UPDATE statement
allows a user to update the current values in a database with new values.
It contains three main clauses. The first clause specifies the table that requires an update, the second clause
specifies the column name and
the data values that will be inserted in place of the current values, and the third clause specifies the criteria for
the records that will be
updated. An example query is given below:
Update Employee{first clause}
Set Fname=”Roger”{second clause}
Lname=”Pressman”
WHERE Empid=1{third clause}
The DELETE statement is a Data Manipulation Language (DML) statement that is used to delete records from
a table, based on the condition
specified in the WHERE clause. If the WHERE clause is omitted, all records in the table are deleted.
The DELETE statement can be rolled back.
Syntax:
DELETE [FROM] TableName
[WHERE condition];
The above two DML commands can therefore be rolled back.



Leave a Reply 0

Your email address will not be published. Required fields are marked *