pymysql module creating tables it is not just data that you can add to databaseif you wish you can programmatically create new tables to be used with an application this process follows exactly the same pattern as those used for insertupdate and delete the only difference is that the command sent to the database contains create statement with description of the table to be created this is illustrated belowimport pymysql open database connection connection pymysql connect('localhost''user''password''uni-database'prepare cursor object using cursor(method cursor connection cursor(tryexecute create command cursor execute("create table log (message varchar( not null)"commit the changes to the database connection commit(exceptrollback the changes if an exception error connection rollback(close the database connection connection close(this creates new table log within the uni-databasethis can be seen by looking at the tables listed for the uni-database within the mysql workbench