SQL UPDATE
In this tutorial, we will discuss how to update statements in the SQL.
To update a table you have mention:
- Name of the table which you want to update.
- WHERE clause which contains rows of the table that should be updated.
There are different scenarios again like you want to update any one particular field or entire row or multiple fields in one particular row or multiple fields in the range of rows.
The table name we use here is users.
what exactly you want to change?
In the below table, I have created, where the name sasi is reflecting twice, so I just want to update the name as lisa.

We need to use the where clause in order to specify or mention where exactly this lisa has to be updated.
Syntax:
Update table_name
SET
column1 = value1,
column2 = value2,
column3 = value3, ...
WHERE condition;
Example:
update users set user_name='lisa'
where user_id=3;
Select * from users;Output:

You could see the Lisa was updated in the third row.
Example:
update users set email='lisa@gmail.com'
where user_id=3;
Select * from users;Output:

Let us go ahead and do it. We can update the data even wherever there are the null values are. So now we will update. We need to update two fields at a time. So, how can we do this one? Let us go ahead and do it.
Example:
update users set email='hari@gmail.com',age=26
where user_id=4;
Select * from users;Output:

So we can see how both the null fields have been updated.