delete and truncate command in sql

Options
- retrieve rows in a table
- remove some part of a table
- remove all rows in a table
- recover all the rows deleted in a table.


CORRECT ANSWER : remove all rows in a table

Discussion Board
DELETE and TRUNCATE

DELETE Command: DELETE command is used to remove rows from a table. A WHERE clause can be used to only remove some rows. If no WHERE condition is specified, all rows will be removed.

TRUNCATE Command: TRUNCATE command removes all rows from a table. The operation cannot be rolled back and no triggers will be fired. As such, TRUNCATE is faster and doesn't use as much undo space as a DELETE.

TRUNCATE is a DDL command, whereas DELETE is a DML command. Therefore, DELETE operations can be rolled back (undone), while TRUNCATE operations cannot be rolled back.

Prajakta Pandit 02-8-2017 11:31 PM

additional explanation

truncate command delete all rows and does auto commit.
delete can delete rows and can be filtered by where statement and can be rollback

mindhead 04-7-2015 11:59 AM

poorly stated

Firstly, this question is poorly stated and should be reworded. Secondly, TRUNCATE AND DELETE are two different commands that you shouldn't group together as one.

***DELETE command is used to remove rows from a table.
***TRUNCATE removes all rows from a table.

TWO VERY DIFFERENT COMMANDS.

smkm 08-18-2014 02:05 PM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement