Q.Write code to connect to a MYSQL database namely School and then fetch all those records from table Student where grade is 'A'.
Answer =
import mysql.connector as a
mydb = a.connect(host="localhost",user="root",password="portal express", database = "School")
cur = mydb.cursor()
run = "select * from Student where grade = 'A' "
cur . execute(run)
data = cur.fetchall()
for i in data :
print(i)
mydb.close()
Wrong answer
ReplyDeleteWhat is wrong in this question.
DeleteNothing is wrong with this answer. It's totally fine and functioning.
Deletehehehe
ReplyDeletehiiiiii : )
DeleteHii
ReplyDeleteHello
DeleteFormat of table student in mysql?
ReplyDeleteDatabase is School right?
ReplyDeleteThen y student...
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )