DROP TABLE, TRUNCATE TABLE AND DELETE IN SQL
Key Word | Syntax | Explanation |
DROP TABLE | DROP TABLE <table_name>; | DROP TABLE is used to delete a table definition and all data from a table |
TRUNCATE TABLE | TRUNCATE TABLE <table_name>; | TRUNCATE TABELE is used to remove all rows or complete data from a table. It doesnโt delete the structure of table. Identity column is reset to its seed value if the table contains any identity column |
DELETE | DELETE FROM <table_name>; | It will delete all the records in table. DELETE retains the identity of the column value. |
DELETE | DELETE FROM <table_name> WHERE<condition/expression>; | Remove rows or specific records from a table based on a WHERE condition. |
DROP TABLE, TRUNCATE TABLE AND DELETE
Leave a Reply