SQL TRUNCATE TABLE Command

    To Delete the complete data from the table we can use the TRUNCATE TABLE command. Up to some extent, it is similar to the DROP Table command but the difference is DROP TABLE delete the complete table include the table data whereas TRUNCATE command only delete the table data the table would still be there.

    SQL TRUNCATE TABLE Command

    <NOTE> be careful when you use the TRUNCATE TABLE command.

    DROP TABLE

    It Deletes the complete table include. Syntax

    DROP TABLE table_name;

    TRUNCATE TABLE

    It only deletes the table data. Syntax

    TRUNCATE TABLE table_name;

    Summary

    • It only deletes the table data.
    • The table would still be present in the table database.

    People are also reading: