here everything will be same , expect we are not taking anything from the database. Rather we are putting the data to the database.
commit() Method. This method sends a COMMIT statement to the MySQL server, committing the current transaction. Since by default Connector/Python does not autocommit, it is important to call this method after every transaction that modifies data for tables that use transactional storage engines.