How to Update Syntax for MySQL
MySQL is a relational database that is optimized to hold data from a website. The "update" statement updates the columns of existing rows with a value specified in the statement. The "set" clause defines which columns should be updated and the new value that should be inserted. You can include a "where" clause to define which of the rows should be updated and which should keep the original value.
Instructions
-
-
1
Log into the MySQL database.
-
2
Type the command "UPDATE table_name SET column="value" WHERE column="orig_value";" to update a column in a table. Replace "table_name" with the correct name of the table. Replace "column" with the column name that you want to update. Replace "value" with the new value. Replace "orig_value" with the original value of the column. For example, if you want to change the ages of all 16-year-old children to 17 years old in the Birthday table, type "UPDATE Birthday SET age='17' WHERE age='16';".
-
-
3
Log out of the MySQL database.
-
1