Examveda

Which keyword is used to delete all the rows from the table?

A. TRUNCATE

B. REMOVE

C. DELETE ALL

D. CLEAR

Answer: Option A

Solution (By Examveda Team)

This question asks about how to remove all the data from a table in MySQL.

Let's break down the options:

Option A: TRUNCATE - This is the correct answer. TRUNCATE is a powerful command in MySQL used to quickly delete all rows from a table. It essentially "empties" the table without deleting the table structure itself.

Option B: REMOVE - This is incorrect. MySQL doesn't use the keyword REMOVE to delete rows.

Option C: DELETE ALL - This is incorrect. While you can use DELETE with a condition like DELETE FROM table_name WHERE condition, using DELETE ALL is not a valid syntax in MySQL.

Option D: CLEAR - This is incorrect. CLEAR is not used to delete rows from a table. It is used to clear the contents of certain database objects, like the CLEAR TABLES command, which empties all tables.

In Summary: The TRUNCATE keyword is the most efficient way to delete all rows from a table in MySQL. It's important to use it cautiously, as it's a destructive action.

This Question Belongs to MySQL >> MySQL Miscellaneous

Join The Discussion

Related Questions on MySQL Miscellaneous