0% found this document useful (0 votes)
19 views1 page

(Record 16) Python Mysql Interface Updation

Uploaded by

yohanmathew1906
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views1 page

(Record 16) Python Mysql Interface Updation

Uploaded by

yohanmathew1906
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

#yohan - 12136

#Record Program 16
#Source Code
import [Link]
mydb = [Link](host ='localhost',user ='root',password='admin',database='cvt11')
mycursor = [Link]()
print("student record updation")
rno = int(input("Enter rno to update the record:"))
query = "select*from student where Roll_no={}".format(rno)
[Link](query)
myrec = [Link]()
if myrec != None:
print('## Record Found - Details are: ##')
print(myrec)
ch = input('Do you want to update marks (y/n):')
if ch == 'y':
marks = float(input('Enter new updated marks:'))
query ='UPDATE student set marks ={} where Roll_no ={}'.format(marks,rno)
[Link](query)
[Link]()
print("## Record(s) updated ##")
else:
print('Sorry ! No such student exists')
[Link]()

#yohan - 12136
#Record Program 16
#Output
student record updation
Enter rno to update the record:12003
## Record Found - Details are: ##
(12003, 'DIVYA', 70.5, 'C')
Do you want to update marks (y/n):y
Enter new updated marks:72.1
## Record(s) updated ##

#Sucharitha Kapuluru - 12131


#Record Program 16
#Table Used

You might also like