SQL DROP TABLE (original) (raw)

Last Updated : 12 Jun, 2026

The DROP TABLE command permanently removes a table from the database.

**Syntax:

DROP TABLE table_name;

The following example demonstrates how to use the DROP TABLE command.

Step1: Create a Database and Table

First, we will create a database and table on which the SQL queries will be run.

CREATE DATABASE NewCafe;
USE NewCafe;

CREATE TABLE categories (
CategoryID INT NOT NULL PRIMARY KEY,
CategoryName NVARCHAR(50) NOT NULL,
ItemDescription NVARCHAR(50) NOT NULL
);

INSERT INTO categories (CategoryID, CategoryName, ItemDescription)
VALUES
(1, 'Beverages', 'Soft Drinks'),
(2, 'Condiments', 'Sweet and Savory Sauces'),
(3, 'Confections', 'Sweet Breads');

SELECT * FROM categories;

**Output:

Screenshot-2026-02-06-121632

Categories Table

At this point, the categories table has been created with three rows of sample data.

Step2: Drop the Table

Now, let’s use the DROP TABLE statement to delete the categories table permanently

**Query:

DROP TABLE categories;

**Output:

Screenshot-2026-02-06-121733

Drop Categories Table

Working of SQL DROP TABLE

The DROP TABLE statement permanently removes a table from the database along with all its associated data and objects.

DROP TABLE IF EXISTS categories;

DROP TEMPORARY TABLE temp_table_name;

SHOW TABLES;