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

MySQL Drop Table


The MySQL 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.


MySQL DROP TABLE Example

The following SQL statement drops the "Shippers" table:

Example

DROP TABLE IF EXISTS Shippers;

MySQL 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 MySQL course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

MySQL Drop Table – FAQs

Quick answers about learning MySQL Drop Table in MySQL.

This free note from CodingNow 2.0 explains MySQL Drop Table in MySQL — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every MySQL topic on CodingNow 2.0, including MySQL Drop Table, is 100% free with no signup required.
With focused practice, most students grasp MySQL 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