Class 12 Practical
Class 12 Practical
B. Complete the following database connectivity program by writing missing statements and
perform the given query.
(4)
import ______________________________ as sqltor #1
mycon = sqltor.________( host = “localhost”, user = “root”, passwd = “123”,
database = “medicine” ) #2
cursor = mycon.cursor( )
cursor.execute(______________________ ) #3
data = cursor._________________ #4
for rec in data:
print ( rec )
mycon.close( )
a. Complete the statement #1,by writing the name of library / package need to import for
database connectivity.
b. Complete the statement #2, write the name of method require to create connection
between python and mysql.
c. Complete the statement #3, write the query to display those drug records which price is
between the 50 to 100 from table DRUG.
d. Complete the statement #4, to retrieve all records from the result set.
Q.2 Report/Practical File
(7)
Q.3 Project
(8)
Q.4 Viva voce
(3)