print("OK")
import mysql.connector
cnx = mysql.connector.connect(user='root', password='jsbc@123',
host='localhost',
database='school')
'''
#CODE TO DELETE THE RECORD
mycursor = cnx.cursor()
#statement ="DELETE from std WHERE r = 4 "
mycursor.execute("CREATE TABLE Mrk (roll int, nm VARCHAR(20), tot_mrk int, per float)")
print("Table Created")
'''
'''
#CODE TO DELETE THE RECORD
mycursor = cnx.cursor()
#statement ="DELETE from std WHERE r = 4 "
mycursor.execute("DELETE from std WHERE r = 3 ")
cnx.commit()
print("Record Delete")
'''
'''
#CODE TO MODIFY THE RECORD
mycursor = cnx.cursor()
statement ="UPDATE std SET nm = 'aaaaaaa' WHERE r = 1 "
mycursor.execute(statement)
cnx.commit()
print("Record modified")
'''
'''
#CODE TO INSERT A NEW RECORD
rn=int(input("Enter a roll number"))
n=input("Enter a name")
sql = "INSERT INTO std (r, nm) VALUES (%s, %s)"
val = (rn,n)
mycursor = cnx.cursor()
mycursor.execute(sql, val)
cnx.commit()
print(mycursor.rowcount, "record inserted.")
'''
'''
#CODE TO RETRIEVE AND DISPLAY THE RECORDS
mycursor = cnx.cursor()
mycursor.execute("SELECT * FROM std")
myresult = mycursor.fetchall()
print("Roll",'\t\t','Name')
for x in myresult:
for b in x:
print(b,end='\t\t ')
print()
'''