import mysql.connector
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)