SQL UPDATE: Modify Table Data
To modify the content of a table, you can use the UPDATE statement in SQL. The syntax is as follows:
UPDATE 表名
SET 列名1 = 值1, 列名2 = 值2, ...
WHERE 条件;
In this statement, the table name represents the name of the table to be modified, column1, column2, etc. are the names of the columns to be modified, value1, value2, etc. are the values to be updated, and condition specifies the condition of the rows to be updated.
For example, to change the name of the student with id 1 in the table students to “Alice”, you can use the following SQL statement:
UPDATE students
SET name = 'Alice'
WHERE id = 1;
Please be aware that the update operation will modify all rows in the table that meet the conditions, so use it with caution.