How to Drop a Table in SQL - Truncate a Table in SQL - SQL Drop and Truncate a Table


How to Drop a Table in SQL - Truncate a Table in SQL - SQL Drop and Truncate a Table 

The drop table command in sql allows you to drop or delete an existing table from the database. It delete the all data as well as the structure of a table from the database.

Syntax for dropping a table:-

drop table <tablename>

Example:-

drop table student_record

Truncating a Table in SQL:-

The truncate command in sql allows you to delete all data from the existing table but the structure of table remain as it is.

This command is same as "delete from <table_name>"

Syntax for truncate a table

truncate table <table_name>

Example:-

truncate table Student_info

{ 0 comments... read them below or add one }

Post a Comment