Thursday, October 5, 2017

Delete a Table

There are 2 operation to delete a table.

  • Delete the whole table structure from database.
Delete the whole table from database means removing both the data and table structure from the database. the SQL command to perform the operation in MySQL/MariaDB is as below:
The example of the SQL command in action is shown in Figure 1 below:
Figure 1: Delete table in database
*This action will remove the table from your database. Do not do this unless you are absolutely sure that you want to delete the table.
  • Delete all data in the table.
Beside deleting the whole table, the database administrator can choose only to empty the content of the table. The SQL command to empty a table in MySQL/MariaDB is:
The example of the SQL command in shown in the Figure 2 below:
Figure 2: 
*This action will remove all the data from your table in the database. Do not do this unless you are absolutely sure that you want to empty the table.