Computer Science - Class 12
Solutions to CBSE Sample Paper - Computer Science Class 12

Riya wants to write a program in Python to update the following record in the table named Product in MYSQL database, SHOP:

pid(Product ID) - integer

pname(Product Name) - string

price(Product Price) – float

Note the following to establish connectivity between Python and MySQL:

  • Username - root

  • Password - tiger

  • Host - localhost

The value of pid has to be accepted from the user and the price has to be increased by 10%. Help Riya to write the program in Python.

Answer:

Answer by student

Python program to update a record in a table in MYSQL database. - Teachoo.png

Detailed answer by teachoo

The rest of the post is locked. Join Teachoo Black to see the full post.

Go Ad-free
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science and Computer Science at Teachoo