Answers

Question and Answer:

  Home  MariaDB

⟩ Do you know what is the use of TRUNCATE statement? How is it different from DELETE statement?

TRUNCATE TABLE statement is used to delete a table permanently. It deletes all the records from the table.

Syntax:

TRUNCATE [TABLE] [database_name.]table_name;

Difference between DELETE and TRUNCATE statement:

☛ DELETE statement is used to remove one or more columns from a table as well as whole table. On the other hand, TRUNCATE TABLE statement is used to delete the whole table permanently.

☛ TRUNCATE TABLE statement is same as DELETE statement without a WHERE clause.

 150 views

More Questions for you: