To update existing records in a table UPDATE statement is used.
UPDATE table
SET column1 = value1,
column2 = value2,
...
column_n = value_n
WHERE conditions;
The WHERE clause specifies which record or records that should be updated. If you not write the WHERE clause query, all records will be updated.
UPDATE students
SET student_name = 'Mitra'
WHERE student_id = 2;
This example will update the student_name as "mitra" where "student_id" is 2.
UPDATE students
SET student_address = 'Kendrapara',
student_name = 'Mitrabhanu'
WHERE student_id = 1;
UPDATE students
SET name = (SELECT student_name
FROM student
WHERE student.student_name = students.name)
WHERE age < 30;