Syntax of UPDATE operator

For editing records in a table exist the SQL operator UPDATE.

General query structure with the UPDATE operator

MySQL
UPDATE table_name
SET table_field1 = table_field_value1,
    table_fieldN = table_field_valueN
[WHERE the_conditions_of_the_limitations]

In the described request structure, optional parameters are specified in square brackets.

So, for example, if you need to change the name, the request will look like this:

MySQL
UPDATE FamilyMembers
SET member_name = "Andie Anthony"
WHERE member_name = "Andie Quincey"

Be careful when updating data. If you skip the UPDATE operator, all entries will be updated.

Calculated Values

In data update requests, you can change values based on previous values.

MySQL
UPDATE Payments
SET unit_price = unit_price * 2

It is also allowed to assign values of some columns to other columns. But at the same time, of course, column types must be compatible.