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;
Let's suppose, we have the following table in the database:
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 :
© Copyright 2021. All Rights Reserved.