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 MAX(AvgMark) FROM STUDENT WHERE Class='12'"
cursor.execute(sql)
max_mark = cursor.fetchone()[0]
print("Answer is:")
print("The maximum mark in class 12 is: {max_mark}")
mycon.close()