0% found this document useful (0 votes)
204 views1 page

SQL UPDATE Command Syntax Explained

The SQL UPDATE statement is used to modify existing rows in a table. It requires specifying the table name, the column names and values to update, and can include a WHERE clause to identify which rows to update. Without a WHERE clause, all rows in the table will be updated. Examples show updating an employee's location where their id is 101, and increasing all employee salaries by 20%.

Uploaded by

venniiii
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
204 views1 page

SQL UPDATE Command Syntax Explained

The SQL UPDATE statement is used to modify existing rows in a table. It requires specifying the table name, the column names and values to update, and can include a WHERE clause to identify which rows to update. Without a WHERE clause, all rows in the table will be updated. Examples show updating an employee's location where their id is 101, and increasing all employee salaries by 20%.

Uploaded by

venniiii
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

SQL UPDATE Statement

The UPDATE Statement is used to modify the existing rows in a table.

The Syntax for SQL UPDATE Command is:


UPDATE SET column_name2 [WHERE condition] column_name1 = = value2, table_name value1, ...

table_name - the table name which has to be updated. column_name1, column_name2.. - the columns that gets changed. value1, value2... - are the new values. NOTE:In the Update statement, WHERE clause identifies the rows that get affected. If you do not include the WHERE clause, column values for all the rows get affected. For Example: To update the location of an employee, the sql update query would be like,

UPDATE SET WHERE id = 101;


To change the salaries of all the employees, the query would be,

employee location ='Mysore'

UPDATE SET salary = salary + (salary * 0.2);

employee

You might also like