Test Index

CBSE Class 12 Computer Science 2022 Paper 91 Get it on Google PlayDownload on the App Store

© examsnet.com
Question : 4 of 13
Marks: +1, -0
Consider the following SQL table MEMBER in a SQL Database CLUB :
Table : MEMBER
M_IDNAMEACTIVITY
M1001AminaGYM
M1002PratikGYM
M1003SimonSWIMMING
M1004RakeshGYM
M1005AvneetSWIMMING
Assume that the required library for establishing the connection between Python and MYSQL is already imported in the given Python code. Also assume that DB is the name of the database connection for table MEMBER stored in the database CLUB.
Predict the output of the following code :
MYCUR = DB.cursor()
MYCUR.execute ("USE CLUB")
MYCUR.execute ("SELECT * FROM MEMBER WHERE ACTIVITY= 'GYM' ")
R=MYCUR.fetchone()
for i in range (2) :
R=MYCUR.fetchone()
print (R[0], R[1], sep = "#")
Advertisements
Go to Question: