Computer Science
To run an SQL query from within Python, you may use <cursor>. …………… method().
- query()
- execute()
- run()
- all of these
Python MySQL
1 Like
Answer
execute()
Reason — The <cursor>.execute()
method is used to run an SQL query from within Python.
Answered By
3 Likes
Related Questions
To fetch one record from the resultset, you may use <cursor>. …………… method.
- fetch()
- fetchone()
- fetchtuple()
- none of these
To fetch multiple records from the resultset, you may use <cursor>. …………… method.
- fetch()
- fetchmany()
- fetchmultiple()
- fetchmore()
To reflect the changes made in the database permanently, you need to run <connection>. …………… method.
- done()
- reflect()
- commit()
- final()
Fill in the blanks:
A database _________ controls the connection to the database. It represents a unique session with a database connected from within a script/program.