MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
____ removes all rows from a table without logging the individual row deletions.
A
DELETE
B
REMOVE
C
DROP
D
TRUNCATE
Explanation: 

Detailed explanation-1: -Removes all rows from a table or specified partitions of a table, without logging the individual row deletions. TRUNCATE TABLE is similar to the DELETE statement with no WHERE clause; however, TRUNCATE TABLE is faster and uses fewer system and transaction log resources.

Detailed explanation-2: -You can use the TRUNCATE statement to quickly remove all rows from a table and also remove all corresponding index data. You cannot recover deleted rows after the transaction is committed. You can use the TRUNCATE statement on tables that contain any type of columns, including smart large objects.

Detailed explanation-3: -Tip: You can delete the contents of a row or column without deleting the table structure. To do this, select the row or column and then press the Delete key.

Detailed explanation-4: -Detailed Solution. All rows in the table will be deleted using the SQL TRUNCATE command. A where clause cannot be used in this.

Detailed explanation-5: -To delete all rows in a table without having the action logged, you can use the TRUNCATE TABLE statement. This statement is often more efficient than using DELETE to delete all rows from a table, as it does not generate a log of each row deletion.

There is 1 question to complete.