IF EXISTS clause is specified, these queries do not return an error if the entity does not exist. If the SYNC modifier is specified, the entity is dropped without delay.
DROP DATABASE
Deletes all tables inside thedb database, then deletes the db database itself.
Syntax:
DROP TABLE
Deletes one or more tables. Syntax:- If the clause
IF EMPTYis specified, the server checks the emptiness of the table only on the replica which received the query. - Deleting multiple tables at once is not an atomic operation, i.e. if the deletion of a table fails, subsequent tables will not be deleted.
DROP DICTIONARY
Deletes the dictionary. Syntax:DROP USER
Deletes a user. Syntax:DROP ROLE
Deletes a role. The deleted role is revoked from all the entities where it was assigned. Syntax:DROP ROW POLICY
Deletes a row policy. Deleted row policy is revoked from all the entities where it was assigned. Syntax:DROP MASKING POLICY
Deletes a masking policy. Syntax:DROP QUOTA
Deletes a quota. The deleted quota is revoked from all the entities where it was assigned. Syntax:DROP SETTINGS PROFILE
Deletes a settings profile. The deleted settings profile is revoked from all the entities where it was assigned. Syntax:DROP VIEW
Deletes a view. Views can be deleted by aDROP TABLE command as well but DROP VIEW checks that [db.]name is a view.
Syntax:
DROP FUNCTION
Deletes a user defined function created by CREATE FUNCTION. System functions can not be dropped. SyntaxDROP NAMED COLLECTION
Deletes a named collection. SyntaxDROP HANDLER
Deletes a SQL-defined HTTP handler created by CREATE HANDLER. SyntaxDROP INDEX
Introduced in: v22.7.0 Deletes a data skipping index of aMergeTree-family table. It is a standalone form of ALTER TABLE ... DROP INDEX and requires the same ALTER DROP INDEX privilege.
Syntax
DROP WORKLOAD
Introduced in: v24.11.0 Deletes a workload created by CREATE WORKLOAD. A workload that is the parent of another workload cannot be dropped. Requires theDROP WORKLOAD privilege.
Syntax
DROP RESOURCE
Introduced in: v24.11.0 Deletes a resource created by CREATE RESOURCE. A resource used in theFOR clause of a workload setting cannot be dropped. Requires the DROP RESOURCE privilege.
Syntax