---
title: "3 Must-know Approaches to Delete a Table"
description: "Here are the top 3 approaches you can try in MySQL and other databases to delete table."
url: https://srinimf.com/2023/01/02/3-approaches-to-delete-table-in-sql/
date: 2023-01-02
modified: 2026-10-07
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2022/12/pexels-photo-6402809.jpeg?fit=1880%2C1253&ssl=1
categories: ["mysql", "SQL"]
tags: ["SQL Delete Table"]
type: post
lang: en
---

# 3 Must-know Approaches to Delete a Table

Deleting a Table in SQL can achieve in three ways. These are VIZ: DELETE, TRUNCATE, and DROP. Each has a specific reason and purpose. This post explains with sample SQL queries.

Below SQL queries perfectly work in MySQL. You can run these in other RDBMS databases with minor changes.

## [SQL DELETE](https://srinimf.com/2010/05/16/db2-delete-in-sql/), TRUNCATE, and DROP statements

The DELETE, TRUNCATE, and DROP what these do

- The DELETE keyword deletes the data in a table but leaves the table intact.
- The TRUNCATE keyword is a faster way to delete the data in a table. The TRUNCATE keyword also preserves the table structure.
- The DROP keyword drops the data and the table itself from a database.

### SQL DELETE Table

The DELETE statement deletes all the rows from the ‘customers’ table. But it keeps the table.

```
DELETE from customers;
```

Advertisements

### SQL TRUNCATE table

The TRUNCATE deletes all the rows and keeps the table. But it’s **faster than DELETE**.

```
TRUNCATE customers;
```

### SQL DROP table

The DROP deletes **both** tables and rows.

```
DROP TABLE IF EXISTS customers;
```

### DELETE a single row

```
SELECT *
FROM table_name
WHERE lname = 'SRINI'
LIMIT 1;
DELETE
FROM table_name
WHERE lname = 'SRINI'
LIMIT 1;
```

> SpotlightDelete query must run with care. Since it would delete all the rows.

### SQL DELETE with CASCADE:

This SQL deletes rows from both the main table and its dependent table.

```
DELETE
FROM customers
Where FNAME = 'Rani'
CASCADE;
```

Related

- [How to Drop [or] Alter Table: Sample SQL Queries](https://srinimf.com/2022/07/03/2-effective-drop-a-table-or-modify-sql-queries/)DateJuly 3, 2022
- [DB2 – DDL (Data Definition Language)](https://srinimf.com/2013/01/19/db2_ddl/)DateJanuary 19, 2013
- [SQL: Truncate Vs Delete in DB2](https://srinimf.com/2014/10/19/truncate-and-delete-in-db2/)DateOctober 19, 2014

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2023%2F01%2F02%2F3-approaches-to-delete-table-in-sql%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2022%2F12%2Fpexels-photo-6402809.jpeg%3Ffit%3D1200%252C800%26ssl%3D1&description=3%20Must-know%20Approaches%20to%20Delete%20a%20Table)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2023/01/02/3-approaches-to-delete-table-in-sql/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2023/01/02/3-approaches-to-delete-table-in-sql/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2023/01/02/3-approaches-to-delete-table-in-sql/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2023/01/02/3-approaches-to-delete-table-in-sql/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%203%20Must-know%20Approaches%20to%20Delete%20a%20Table&body=https%3A%2F%2Fsrinimf.com%2F2023%2F01%2F02%2F3-approaches-to-delete-table-in-sql%2F&share=email)
-

### Like this:

Like Loading…
