MariaDB is an open-source Database Management System and its predecessor to MySQL. The pymysql client can be used to interact with MariaDB similar to that of MySQL using Python.
In this article, we will look into the process of using the UPDATE query on a table of the database using pymysql. The update is used to change the existing values in a database. By using the update statement a specific value can be corrected or updated. It only affects the data and not the structure of the table. The basic advantage provided by this command is that it keeps the table accurate.
UPDATE tablename SET column_nmae = "new value" WHERE conditions;
The following programs will help you understand this better.
Example 1 :
In the above program, We update Broad Band price from 1200 to 1400.
Example 2 :
In the above program, We update PRODUCT_ID to A123 WHERE price = 14782 AND PRODUCT_TYPE = ‘Voice’.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Python MariaDB - Select Query using PyMySQL
- Python MariaDB - Delete Query using PyMySQL
- Create Database in MariaDB using PyMySQL in Python
- Python MariaDB - Drop Table using PyMySQL
- Python MariaDB - Order By Clause using PyMySQL
- Python MariaDB - Limit Clause using PyMySQL
- Python MariaDB - Where Clause using PyMySQL
- Python MariaDB - Insert into Table using PyMySQL
- Connect to MySQL using PyMySQL in Python
- Python MySQL - Update Query
- Python | Update a list of tuples using another list
- How to update data in a Collection using Python?
- How to get COVID 19 update using Covid module in Python?
- Char_Length()Function AND ASCII() Function in MariaDB
- Python | Get a set of places according to search query using Google Places API
- Update all Documents in a Collection using PyMongo
- Dictionary Methods in Python | Set 2 (update(), has_key(), fromkeys()...)
- MongoDB Python | Insert and Update Data
- Python Set | update()
- Python Dictionary | update() method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.