Consider table ‘Faculty’ in database EngColl with following structure.
Id - Faculty id. (Primary Key)
lastname - Lastname of the faculty member
Firstname - Firstname of the faculty member
locationid - Location id of the member.
phone - Phone Number of the member.
rank - It can be either ‘ASSO’, ‘FULL’,
startdate - date of joining of the member. Write a Python code to update the rank of the member as ‘FULL’ for all the records whose data of joining is before 31/3/1998.
Password of database is pwdfac, and userid is Fac_ dep
mydb = mysql.connector.connect('localhost','Fac_dep','pwdfac','EngColl')
cursor = mydb.cursor()
sql = "UPDATE faculty set rank='FULL' where startdate<'1998-03-31';"