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 Create a Simple Calculator - The Coding Shala

N-th Tribonacci Number Solution - The Coding Shala

Java Program to Convert Binary to Decimal - The Coding Shala

LeetCode - Shuffle the Array Solution - The Coding Shala

Introduction to Kotlin Programming Language for Backend Development - The Coding Shala