mycon
= mysql.connector
.connect
( host='localhost',
user='root',
password='password',
database='School')
if mycon.is_connected():
print('Database connected')
cursor = mycon.cursor()
sql ="SELECT * FROM STUDENT WHERE Stream='Medical'"
cursor.execute(sql)
records = cursor.fetchall()
print("Answer is:")
for rec in records:
print(rec)
mycon.close()
aW1wb3J0IG15c3FsLmNvbm5lY3RvcgpteWNvbiA9IG15c3FsLmNvbm5lY3Rvci5jb25uZWN0KAogICAgIGhvc3Q9J2xvY2FsaG9zdCcsCiAgICAgdXNlcj0ncm9vdCcsIAogICAgIHBhc3N3b3JkPSdwYXNzd29yZCcsCiAgICAgZGF0YWJhc2U9J1NjaG9vbCcpCmlmIG15Y29uLmlzX2Nvbm5lY3RlZCgpOgogICBwcmludCgnRGF0YWJhc2UgY29ubmVjdGVkJykKY3Vyc29yID0gbXljb24uY3Vyc29yKCkKc3FsID0iU0VMRUNUICogRlJPTSBTVFVERU5UIFdIRVJFIFN0cmVhbT0nTWVkaWNhbCciCmN1cnNvci5leGVjdXRlKHNxbCkKcmVjb3JkcyA9IGN1cnNvci5mZXRjaGFsbCgpCnByaW50KCJBbnN3ZXIgaXM6IikKZm9yIHJlYyBpbiByZWNvcmRzOgpwcmludChyZWMpCm15Y29uLmNsb3NlKCk=