Skip to main content
Skip to main content

DROP Statements

Deletes existing entity. If the 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 the db database, then deletes the db database itself.

Syntax:

DROP TABLE​

Deletes one or more tables.

Tip

To undo the deletion of a table, please see UNDROP TABLE

Syntax:

Limitations:

  • If the clause IF EMPTY is 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 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 a DROP 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.

Syntax

Example

DROP NAMED COLLECTION​

Deletes a named collection.

Syntax

Example