HOW TO DROP, TRUNCATE AND DELETE TABLE?

252 viewsSQLSQL
0
DROP VS TRUNCATE VS DELETE In SQL
DROP VS TRUNCATE VS DELETE In SQL
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
Saraswat World Changed status to publish June 14, 2023
Write your answer.

Posted

in

Tags:

Comments

Leave a Reply

A Tribute to Dilip Kumar