Test Index
CBSE Class 12 Computer Science 2022 Paper 91
© examsnet.com
Question : 4 of 13
Marks:
+1,
-0
Consider the following SQL table MEMBER in a SQL Database CLUB :Table : MEMBER
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 :
M_ID | NAME | ACTIVITY |
|---|---|---|
M1001 | Amina | GYM |
M1002 | Pratik | GYM |
M1003 | Simon | SWIMMING |
M1004 | Rakesh | GYM |
M1005 | Avneet | SWIMMING |
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 = "#")
Go to Question: