Skip to content
Blog

Drop

Dropping a table removes the table and all its data from the database.

For example, consider the following database:

CREATE NODE TABLE User(name STRING, age INT64, reg_date DATE, PRIMARY KEY (name));
CREATE REL TABLE Follows(FROM User TO User, since DATE);

Directly dropping the User node table will fail.

DROP TABLE User
Binder exception: Cannot delete a node table with edges. It is on the edges of rel: Follows.

You can first delete the Follows rel table, and subsequently the User table as follows:

DROP TABLE Follows
---------------------------------------
| RelTable: Follows has been dropped. |
---------------------------------------
DROP TABLE User
-------------------------------------
| NodeTable: User has been dropped. |
-------------------------------------