Updating a table

 In this lesson we are going to study about how to update  a table data.

Update:
  • Changing the existing data.
  • Must include "where" clause in update statement to change perticular records.

Syntax:

UPDATE Table Table_name Set
Column1=Value..,ColumnN=Value
Where condition


   In this syntax update table,Set and Where are all keywords.Table_name specifies the name of the Table .Column1... are the name of the columns where we are going to change the value in a where clause we specifies the condition to perform the update statement.


Example:-

 Single-rows : Update the city to kolkata of employee abhishek

update empdtls set
city="kolkata"
where emp_name="abhishek"
 
Multiple-rows: salary incremented by 1000 of all MANAGER.

update empdtls set
salary=salary+1000
where job="MANAGER"
 
All-rows: salary incremented by 1000 of all employees

update empdtls set
salary=salary+1000


 I am interested in hearing your feedback, so that I can improve my articles and learning resources for you.connect with us on facebooktwitter

Share

Did you enjoy reading this and found it useful? If so, please share it with your friends:

No comments:

Post a Comment