Popular Tutorials
HTML
View allJavaScript
View allMySQL Update Record
MySQL UPDATE query is a DML statement used to modify the data of the MySQL table within the database. In a real-life scenario, records are changed over a period of time. So, we need to make changes in the values of the tables also. To do so, it is required to use the UPDATE query.
The UPDATE statement is used with the SET and WHERE clauses. The SET clause is used to change the values of the specified column. We can update single or multiple columns at a time.
Syntax
Following is a generic syntax of UPDATE command to modify data into the MySQL table:
UPDATE table_name SET column_name1 = new-value1, column_name2=new-value2, ... [WHERE Clause]
table_name : It is the name of a table in which we want to perform updation.
column_name : It is the name of a column in which we want to perform updation with the new value using the SET clause. If there is a need to update multiple columns, separate the columns with a comma operator by specifying the value in each column.
WHERE Clause It is optional. It is used to specify the row name in which we are going to perform updation. If we omit this clause, MySQL updates all rows.
WHERE Clause : It is optional. It is used to specify the row name in which we are going to perform updation. If we omit this clause, MySQL updates all rows.
Let's move on to delete record in MySQL
Share this page on :
© 2022 AnalyzeCode.com All rights reserved.