76
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:
Let’s change the student_name ‘Aryan’ where ‘student_name’ was “Ajeet”.
Query is executed successfully. Now check the updated data:
Output:
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”.
The columns are updated now. You can check and verify the result by using SELECT statement:
Output:
Next TopicMariaDB Delete