Please note, this is a STATIC archive of website www.javatpoint.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
Javatpoint Logo
Javatpoint Logo

MariaDB Update Data

In MariaDB, UPDATE statement is used to modify the existing fields by changing values in a table.

Syntax:

Or

The UPDATE statement can be used with WHERE, ORDER BY and LIMIT clause.

Example:


UPDATE a Single Column

We have a table "Students", having the following data:

Mariadb Update 1

Let's change the student_name 'Aryan' where 'student_name' was "Ajeet".

Mariadb Update 2

Query is executed successfully. Now check the updated data:

Output:

Mariadb Update 3

Example2:


UPDATE Multiple Columns

You can also update more than one columns using the UPDATE satatement in MariaDB database. In the following example, we update two columns "student_name" and "student_address" in the table "Students" where "student_name" was "Alecia".

Mariadb Update 4

The columns are updated now. You can check and verify the result by using SELECT statement:

Output:

Mariadb Update 5
Next TopicMariaDB Delete





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA