SQL DROP TABLE - The Coding Shala

Home >> Learn Sql >> SQL DROP Table

SQL DROP TABLE STATEMENT

SQL DROP TABLE Statement is used to delete a table from the database and all its data from the database.
SQL DROP TABLE - The Coding Shala

SQL DROP TABLE Syntax

The following DROP TABLE statement is used to delete tables from the database -  
 DROP TABLE table_name;  

SQL DROP TABLE Example

The following statement removes the 'Persons' Table from the database and all of its data from the database-
 DROP TABLE Persons;  

SQL TRUNCATE TABLE

  • 'TRUNCATE' command is used to delete the data of a table, not the table itself.

SQL TRUNCATE TABLE Syntax

The following SQL statement is used to truncate table - 
 TRUNCATE TABLE table_name;  


Other Posts You May Like
Prev<< SQL CREATE Table                                                      NEXT >>SQL INSERT Query
Please leave a comment below if you like this post or found some error, it will help me to improve my content.

Comments

Popular Posts from this Blog

Shell Script to find sum, product and average of given numbers - The Coding Shala

Shell Script to Create a Simple Calculator - The Coding Shala

Add two numbers in Scala - The Coding Shala

New Year Chaos Solution - The Coding Shala

Richest Customer Wealth LeetCode Solution - The Coding Shala