🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to SQL Notes
Topic #51

SQL Drop Table


The SQL DROP TABLE Statement

The DROP TABLE statement is used to permanently delete an existing table in a database.

Note: Be careful before dropping a table! Dropping a table deletes the entire table and all its content!

Syntax

DROP TABLE table_name;

To prevent an error from occur (if the table does not exists), it is a good practice to add the IF EXISTS clause:

DROP TABLE IF EXISTS table_name;

Note: In most databases you cannot drop a table that is referenced by a foreign key constraint in another table. To solve this, you must remove the foreign key constraint or drop the dependent table.


DROP TABLE Example

The following SQL statement drops the "Shippers" table:

Example

DROP TABLE IF EXISTS Shippers;

SQL TRUNCATE TABLE

The TRUNCATE TABLE statement is used to delete all the records in a table, but it keeps the table structure, columns and constraints.

Syntax

TRUNCATE TABLE table_name;

Want to go beyond the notes?

Join CodingNow 2.0's SQL course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

SQL Drop Table – FAQs

Quick answers about learning SQL Drop Table in SQL.

This free note from CodingNow 2.0 explains SQL Drop Table in SQL — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every SQL topic on CodingNow 2.0, including SQL Drop Table, is 100% free with no signup required.
With focused practice, most students grasp SQL Drop Table in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now