To run an SQL query from within Python, you may use <cursor>. ............... method().
execute()
Reason — The <cursor>.execute() method is used to run an SQL query from within Python.
<cursor>.execute()