Python Programming MCQs - Unit 5
Python Programming MCQs - Unit 5
A
Username, Password, Hostname, Database Name, Port.
B
Username, Password, Hostname
C
Username, Password, Hostname, Database Name
D
Username, Password
Correct Answer
Username, Password, Hostname, Database Name
A
cursor.executemany(query, rows)
B
cursor.execute(query, rows)
C
cursor.executmultiple(query, rows)
D
cursor.executAll(query, rows)
Correct Answer
cursor.executemany(query, rows)
A
connection.commit()
B
cursor.commit()
C
connection.cursor.commit()
D
commit()
Correct Answer
connection.commit()
A
conn=MySQLdb.connect(host="localhost",user="root",pwd="root",databse="Sampledb")
B
conn=MySQLdb.connect("localhost","root","root","Sampledb")
C
conn=MYSQLDB.connect("localhost","root","root","Sampledb")
D
conn=connect("localhost","root","root","Sampledb")
Correct Answer
conn=MySQLdb.connect("localhost","root","root","Sampledb")
A
cursor.execute ()
B
cursor.fetchall()
C
cursor.fecthone()
D
cursor.run()
Correct Answer
cursor.fetchall()
A
tuple
B
dictionary
C
list
D
set
Correct Answer
list
A
Object
B
Method
C
Class
D
Variable
Correct Answer
Class
A
Object
B
Class
C
Method
D
Variable
Correct Answer
Object
A
createengine()
B
engine()
C
create_engine()
D
create()
Correct Answer
create_engine()
A
create_engine('mysql+mysqlconnector://root:root@localhost/Collegedb')
B
create_engine('mysqlmysqlconnector://root:root@localhost/Collegedb')
C
create_engine('mysql:mysqlconnector://:root@localhost/Collegedb')
D
create_engine('mysql+mysqlconnector://:@localhost/Collegedb')
Correct Answer
create_engine('mysql+mysqlconnector://root:root@localhost/Collegedb')
A
To Insert
B
To Update
C
To Delete
D
All The Above
Correct Answer
All The Above
A
add()
B
update()
C
add_all()
D
All the above
Correct Answer
add_all()
A
add()
B
query()
C
update()
D
add_all()
Correct Answer
query()
A
execute()
B
query()
C
filter()
D
add_all()
Correct Answer
filter()
A
Condition
B
Lock
C
Event
D
Semaphore
Correct Answer
Semaphore
A
cursor.fetchsize(SIZE)
B
cursor.fetchmany(SIZE)
C
cursor.fetchonly(SIZE)
D
cursor.fetchall(SIZE)
Correct Answer
cursor.fetchmany(SIZE)