Blog

SQL Update

SQL

SQL Update

This is the Employee table on which we are going to perform the update operation, where the Country column is NULL

select_sql
				
					UPDATE EMPLOYEE SET COUNTRY = 'UK'
				
			

After running the above Update query we will see that all the rows of the country column has been updated to UK.

sql update

Now if we want to Update a particular row of the above table, we will run the below query with where condition.

				
					UPDATE EMPLOYEE SET COUNTRY = 'FR' WHERE EmployeeId = 4
				
			

In the above query we are updating a particular row of a table using the where condition. So here we have updated country column of the Employee table for EmployeeId 4 with FR.

SQL_Update

Please comment and share if you like this post and tell us about how we can enhance our posts. Thanks.

Subhajit