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)

Ask a doubt
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.