Video Tutorial 7 SQL. UPDATE SET with MySql Workbench

The SQL UPDATE Statement

The UPDATE statement is used to update existing records in a table.

It allows you to set which fields to update and with what data to update the field.

SQL UPDATE Syntax

The basic syntax of the UPDATE statement is as follows:

    UPDATE table_name
SET column_name = value
WHERE condition
    

SQL UPDATE EXAMPLE

We are first going to take a look at the data of the table "publisher2" to see what we had;

We update the columns "phone" and "name" where the "idpublisher=4" in the table "publisher2" with;

UPDATE eli.publisher2 SET phone='111 111', name='OLD STORE' WHERE idpublisher=4;

We can now take a look at the table "publisher2" and see that the data has been updated correctly;

<< Previous Next >>