<a id="flink-sql-drop-materialized-table"></a>

# DROP MATERIALIZED TABLE Statement in Confluent Cloud for Apache Flink

The `DROP MATERIALIZED TABLE` statement removes a materialized table
definition from Confluent Cloud for Apache Flink® and deletes its associated resources.

## Syntax

```sql
DROP MATERIALIZED TABLE [IF EXISTS] [catalog_name.][db_name.]table_name
```

## Parameters

`IF EXISTS`
: Optional clause that prevents an error if the materialized table does not
  exist.

`table_name`
: The name of the materialized table to drop.

## Description

The `DROP MATERIALIZED TABLE` statement performs the following actions:

- Stops the continuous query that powers the materialized table.
- Removes the materialized table definition from the catalog.
- Deletes the backing Apache Kafka® topic and its data permanently.
- Deletes the associated schema versions from Schema Registry.

### Important considerations

- The `DROP MATERIALIZED TABLE` operation permanently deletes the Kafka topic
  data. This action cannot be undone.
- Running statements or other materialized tables that depend on the dropped
  materialized table are affected.
- Stop dependent statements before dropping a materialized table.

## Examples

```sql
-- Drop a materialized table.
DROP MATERIALIZED TABLE enriched_orders;

-- Drop a materialized table if it exists.
DROP MATERIALIZED TABLE IF EXISTS enriched_orders;
```

## Related content

- [CREATE MATERIALIZED TABLE](create-materialized-table.md#flink-sql-create-materialized-table)
- [CREATE OR ALTER MATERIALIZED TABLE](create-or-alter-materialized-table.md#flink-sql-create-or-alter-materialized-table)
- [DROP TABLE](drop-table.md#flink-sql-drop-table)

#### NOTE
This website includes content developed at the [Apache Software Foundation](https://www.apache.org/)
under the terms of the [Apache License v2](https://www.apache.org/licenses/LICENSE-2.0.html).
