Check sibling questions

Which of the following is invalid method for fetching the records from database within Python?

(A) fetchone()

(B) fetchmany()

(C) fetchall()

(D) fetchmulti()

 

Answer:

There are 3 methods used for fetching the records from a database within python.

Method

Used to 

fetchone( )

Returns one row from the result set

fetchmany([size])

Returns the number of rows specified by the size parameter

fetchall( )

Returns all the rows from the result set

 

Checking the options

  • (A) fetchone( ) - It is a valid method for fetching records from a database within python.
  • (B) fetchmany( ) - It is a valid method for fetching records from a database within python.   
  • (C) fetchall( ) - It is a valid method for fetching records from a database within python.
  • (D) fetchmulti( ) - It is not a valid method for fetching records from a database within python.

 

So, the correct answer is (D)

983 students joined Teachoo Black. What are you waiting for?

Davneet Singh's photo - Teacher, Engineer, Marketer

Made by

Davneet Singh

Davneet Singh is a graduate from Indian Institute of Technology, Kanpur. He has been teaching from the past 12 years. He provides courses for Maths and Science at Teachoo.