A resultset is extracted from the database using the cursor object (that has been already created) by giving the following statement. 

Mydata=cursor.fetchone() 

(a) How many records will be returned by the fetchone() method? 

Answer

One record

Explanation: fetchone() method returns a single record or None if no more rows are available .

 

(b) What will be the datatype of Mydata object after the given command is executed? 

Answer

tuple

Explanation: By default fetchone() method retrieves the result set as tuple , since tuple items are stored in a single variable and the items are ordered , unchangeable , and allows duplicate values .

Slide13.JPG

Slide14.JPG
Slide15.JPG

 

 

Remove Ads
Teachoo · Class 12 Explore Class 12
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh is an IIT Kanpur graduate and has been teaching for 16+ years. At Teachoo, he breaks down Maths, Science and Computer Science into simple steps so students understand concepts deeply and score with confidence.

Many students prefer Teachoo Black for a smooth, ad-free learning experience.