FUNCTIONS AND MODULES
MODULES:
Import [Link]:
By importing this package,we are able to establish the connection
between SQL and Python.
FUNCTIONS:
• connect():
This function establishes connection between Python and
MYSQL
• cursor():
It is a special control structure that facilitates the row-by-
row processing of records in the result set.
• execute():
This function is used to execute the sql query and retrieve
records using python.
• def():
A function is a block of code whick only runs when it is called.
• fetchall():
This function will return all the rows from the result set in the
form of a tuple containing the records.
• fetchone():
This function will return one row from the result set in the form
of a tuple containing the records.
• commit():
This function provides changes in the databases
physically.