A

Admin • 833.24K Points
Coach

Q. Which command removes all rows from a table but keeps the table structure and resets AUTO_INCREMENT?

  • (A) DELETE FROM table_name
  • (B) DROP TABLE table_name
  • (C) TRUNCATE TABLE table_name
  • (D) REMOVE ALL FROM table_name
  • Correct Answer - Option(C)
  • Views: 22
  • Filed under category MySQL
  • Hashtags:

Explanation by: Admin

TRUNCATE deletes all rows, resets AUTO_INCREMENT, and is faster because it's DDL. DELETE FROM removes rows but does not reset AUTO_INCREMENT unless explicitly handled and can be slower. DROP TABLE removes the table structure. REMOVE ALL is invalid.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.