SQL – UPDATE Statement (to update record in table)

SQL – UPDATE Statement: In this article, we will figure out how to refresh a record utilizing ‘UPDATE‘ proclamation in SQL.

Update proclamation is utilized to refresh/change any information/record that as of now exists in a table.

Syntax:

UPDATE table_name SET column1=value1, column2=value2, column3=value3, ...
WHERE condition;

Here,

  • table_name: name of the table into which we need to embed information.
  • column1, column2, … : names of the segments/fields.
  • value1, value2, … : values of the segment/fields indicated.
  • condition: the condition characterizes which information will be refreshed.

We can likewise refresh different columns/records one after another by changing the condition in ‘WHERE statement‘.

SQL - UPDATE Statement (to update record in table)

Examples:

1) To refresh the name of the understudy whose Enroll_No is 4

UPDATE Student SET Student_name = 'Vaibhav' WHERE Enroll_No = 4;
SQL - UPDATE Statement (to update record in table)

2) To refresh city of the considerable number of understudies to Mumbai

UPDATE Student SET City = 'Mumbai';
SQL - UPDATE Statement (to update record in table)

Leave a Comment

error: Alert: Content is protected!!