UPDATE

The UPDATE statement allows you to change the data in a table.

Structure:
UPDATE table_name
SET column_name = value
WHERE column_name = value;

 

Example1:

We want to change the data in the Staff table. We will change the name Staff_Name. We’ll rename Frank Samantha.

 

UPDATE Staff
SET Staff_Name = 'Samantha'
WHERE Staff_Name = 'Frank';

 

Example2:

Now let’s edit the record with Thomas. Change Staff_Name to Brondas, SupervisorID field to 1.

UPDATE Staff
SET Staff_Name = 'Brondas', SupervisorID = 1
WHERE Staff_Name = 'Thomas';

 

Leave a Comment

Your email address will not be published. Required fields are marked *