Python MariaDB – Drop Table using PyMySQL
MariaDB is an open source Database Management System and its predecessor to MySQL. The pymysql client can be used to interact with MariaDB similar to that of MySQL using Python.
In this article we will look into the process of Dropping a table from a database using pymysql. To drop a table use any of the below syntax:
DROP TABLE tablename; DROP TABLE IF EXISTS tablename;
The following programs will help you understand this better.
Example 1 :
Program to demonstrate drop if exists. We will try to drop a table which does not exist in the above database.
Example 2 :
Here we will drop the student table.