Deletes a table and the data it contains from the database.
See also: SQL Statements for MariaDB Xpand 6.1
DROP [TEMPORARY] TABLE [IF EXISTS] <tbl_name> [, <tbl_name>] ...
To delete a table in the currently selected database:
DROP TABLE tbl1;
The built-in function
DATABASE() returns the currently selected database.
To explicitly specify a database from which to delete a table, use the
DROP TABLE db1.tbl1;
By default, if you try to delete a table that does not exist, an error is raised.
To prevent an error when the specified table is not present, add the
IF EXISTS clause:
DROP TABLE IF EXISTS tbl1;
If the specified table exists, it will be deleted. If the specified table does not exist, the query does not raise an error.
DROP TEMPORARY TABLE
To delete a temporary table:
DROP TEMPORARY TABLE tbl1;
Delete Multiple Tables
To delete multiple tables at once, specify the names separated by commas:
DROP TABLE db1.tbl1, db2.tbl1, db3.tbl1;
If some of the tables in the argument list do not exist, MariaDB Xpand will drop the tables that do exist and return an error listing non-existing tables it was unable to drop.