codescracker


sql

SQL Update



« Previous Tutorial Next Tutorial »


SQL UPDATE statement is used to update the records present in the table. Here is the general form of the UPDATE statement in SQL to update the records:

UPDATE table_name
SET col1=val1,col2=val2,...
WHERE some_column=some_value;

SQL UPDATE Example

Let's suppose, we have the following table in the database:

SQL update

Following is an example, which would update the ADDRESS for a customer whose ID is 3:

UPDATE CUSTOMERS
SET ADDRESS = 'New Delhi'
WHERE ID = 3;

After querying the above SQL statements, it will update the above table, set the new address of Ritesh Kumar Singh. Now the new table will look like :

sql update statement

« Previous Tutorial Next Tutorial »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test