Update command in SQL

In this tutorial section, we will discuss on what is an UPDATE query in SQL and how to update records using SQL UPDATE query in a SQL Table with a Demo.

Watch this Update Query in SQL video

A Brief Introduction to the UPDATE Query in SQL

The UPDATE command in SQL is used to modify or change the existing records in a table. If we want to update a particular value, then we use the WHERE clause along with the UPDATE clause.

Syntax

UPDATE table_name
SET col1=val1, col2=val2…
[Where condition];

where UPDATE, SET, and WHERE are the keywords, table_name is the name of the table you want update, col1, col2, … are the columns considered to be updated, val1, val2, … assign new values, and the condition section is where the condition is given, followed by a semicolon.