MySQL SQLLesson 14Free preview
MySQL UPDATE
This lesson is part of MySQL · All levels
Summary
The UPDATE command is used to change the value of an existing row in a table based on the condition in the WHERE clause. Without WHERE, the entire row of the table will change, so almost always it is mandatory to include WHERE when working with real data. MySQL also supports multi-table UPDATE and multiple column changes in one command.
Key points
- UPDATE the name_table SET column = WHERE value of the condition; is the basic form
- The WHERE clause is very important so that not all lines are involved in the change
- Several columns can be changed at once by separating the column pair = values using a comma
- Ideally, run SELECT with the same WHERE to verify which line will be affected.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.