DROP TABLE in MariaDB
MariaDB’s DROP TABLE command is designed to delete a current table as well as all the data and objects related to it. The main scenarios for the use of DROP TABLE are the removal of outdated tables, reforming database structures, or starting from scratch when required. With the help of DROP TABLE, the data can be deleted permanently.
Syntax:
DROP TABLE [IF EXISTS] table_name;
Explanation:
- DROP TABLE: This is the main clause to drop the table.
- IF EXISTS: This is the optional clause. It ensures that the command does not produce an error if the specified table does not exist.
- table_name: Name of the table.
Syntax to drop Multiple Tables:
DROP TABLE [IS EXISTS] table1, table2, table3,...;
Explanation: In this syntax, you specify a comma list of tables you want to remove after the drop table keywords.
Drop Table in MariaDB
MariaDB is one of the most widely used open-source relational database management systems, it offers many useful commands for manipulating database structures. It supports the same features that MySQL does but with additional features. Some of the most significant features are new storage engines, JSON API support, and parallel data replication.
One such command that performs an important role in database administration is the DROP TABLE command. In this article, We will discuss the DROP TABLE command in MariaDB along with syntax, table creation, and examples of dropping the table using multiple methods.