SQL UPDATE Query | UPDATE With Multiple Columns | UPDATE With joins

SQL Update Query

The SQL UPDATE Statement or Query is used to modify the existing records or rows in a table or we can say UPDATE is used to modify data in a database table.

Syntax for SQL UPDATE is:

In the Update statement, WHERE clause identifies the rows that get affected by particular condition. If you do not include the WHERE clause, then all the rows get affected.

SQL Update Statement | Tech-Mirror
SQL Update Statement | Tech-Mirror

For Example: To update the city of an employee, the sql update query would be like,

So, if we do not specify the WHERE clause, then all rows get changed its values.

For Example: To change the salaries of all the employees with 2% Increment, new salary will set to the all employees, the query would be like,

Update can be used to modify one column at a time or multiple columns at a time.

Now How can we update multiple columns at a time?

For Example: To update the city and salary of an employee, the sql update query would be like,


The syntax for the UPDATE statement when updating one table with data from another table in SQL Server,

For Example:


The syntax for the SQL Server UPDATE when updating one table with data from another table like,

For Example:

For More SQL Commands

Leave a Reply

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