In this tutorial, you will learn, how to update the database table’s record using the mysql update query. Use the below syntax to write the update query:
UPDATE table_name SET field1 = new-value1, field2 = new-value2
Example based on above update query syntax:
SET emp_name = 'Ramesh Singh'
WHERE emp_id = 12;
Above query will update the employee name from the old name to new name as “Ramesh Singh” based on emp_id. After that execute the below mysql query to see the updated records from employee table.
SELECT * FROM employee;
After executing the above select query, you will see the updated records.