SQL Drop – SQL TUTORIAL | Software Testing Material

SQL Drop Table:

The SQL DROP TABLE statement is used to delete a table definition and all data, indexes, triggers, constraints, and permission specifications for that table.

NOTE: Once a table is deleted then all the information in the table would be lost forever. Please be careful while using this statement. .


Before executing the DROP table, we first check whether the required table is available in the Database or not.

SQL Select Query

Now let’s execute SQL Drop Table statement to drop the table.

SQL Drop Query

Execute the above mentioned SELECT query again and check it out. An error message will display as mentioned below.

Check the below mentioned image.

SQL Drop

SQL Drop Database:

Let’s see how to delete a database completely.

The DROP DATABASE statement is used to delete a database


Let’s see how to truncate data from a table:

if we only want to delete the data inside the table, and not the table itself?

Then, use the TRUNCATE TABLE statement:

In the next tutorial, we will learn JOINS in SQL

Check out the complete SQL Tutorial by clicking on below link:

Sharing is caring.

Share on facebook
Share on twitter
Share on linkedin

Like This Post?

We have a lot more where that came from?

We only send really good stuff occasionally, promise.

Rajkumar SM

Leave a Comment

Your email address will not be published. Required fields are marked *

Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on whatsapp

Recent Posts:

Scroll to Top
API Testing eBook