ClickHouse/docs/en/sql-reference/statements/drop.md
Denis Zhuravlev 813f5d3265
Doc. Update drop.md (#12644)
* Update drop.md

DROP VIEW added

* Update drop.md

* Update drop.md

* Update docs/en/sql-reference/statements/drop.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>
2020-07-21 22:24:08 +03:00

1.8 KiB
Raw Blame History

toc_priority
46

DROP Statements

Deletes existing entity. If IF EXISTS clause is specified, these queries doesnt return an error if the entity doesnt exist.

DROP DATABASE

DROP DATABASE [IF EXISTS] db [ON CLUSTER cluster]

Deletes all tables inside the db database, then deletes the db database itself.

DROP TABLE

DROP [TEMPORARY] TABLE [IF EXISTS] [db.]name [ON CLUSTER cluster]

Deletes the table.

DROP DICTIONARY

DROP DICTIONARY [IF EXISTS] [db.]name

Deletes the dictionary.

DROP USER

DROP USER [IF EXISTS] name [,...] [ON CLUSTER cluster_name]

Deletes a user.

DROP ROLE

DROP ROLE [IF EXISTS] name [,...] [ON CLUSTER cluster_name]

Deletes a role.

Deleted role is revoked from all the entities where it was assigned.

DROP ROW POLICY

DROP [ROW] POLICY [IF EXISTS] name [,...] ON [database.]table [,...] [ON CLUSTER cluster_name]

Deletes a row policy.

Deleted row policy is revoked from all the entities where it was assigned.

DROP QUOTA

DROP QUOTA [IF EXISTS] name [,...] [ON CLUSTER cluster_name]

Deletes a quota.

Deleted quota is revoked from all the entities where it was assigned.

DROP SETTINGS PROFILE

DROP [SETTINGS] PROFILE [IF EXISTS] name [,...] [ON CLUSTER cluster_name]

Deletes a settings profile.

Deleted settings profile is revoked from all the entities where it was assigned.

DROP VIEW

DROP VIEW [IF EXISTS] [db.]name [ON CLUSTER cluster]

Deletes a view. Views can be deleted by a DROP TABLE command as well but DROP VIEW checks that [db.]name is a view.