---
title: "DROP TABLE"
url: "https://docs.yugabyte.com/stable/api/ycql/ddl_drop_table/"
---

# DROP TABLE

Use the DROP TABLE statement to remove a table and all of its data from the database.

## Synopsis

Use the `DROP TABLE` statement to remove a table and all of its data from the database.

## Syntax

### Diagram

DROPTABLEIFEXISTS[table\_name](/stable/api/ycql/grammar_diagrams#table-name)

### Grammar

```ebnf
drop_table ::= DROP TABLE [ IF EXISTS ] table_name;
```

Where

- `table_name` is an identifier (possibly qualified with a keyspace name).

## Semantics

- An error is raised if the specified `table_name` does not exist unless `IF EXISTS` option is present.
- Associated objects to `table_name` such as prepared statements will be eventually invalidated after the drop statement is completed.

## Examples

```sql
ycqlsh:example> CREATE TABLE users(id INT PRIMARY KEY, name TEXT);
```

```sql
ycqlsh:example> DROP TABLE users;
```

## See also

- [ALTER TABLE](/stable/api/ycql/ddl_alter_table "ALTER TABLE")
- [CREATE TABLE](/stable/api/ycql/ddl_create_table "CREATE TABLE")
- [DELETE](/stable/api/ycql/dml_delete/ "DELETE")
- [INSERT](/stable/api/ycql/dml_insert "INSERT")
- [SELECT](/stable/api/ycql/dml_select/ "SELECT")
- [UPDATE](/stable/api/ycql/dml_update/ "UPDATE")
