We learned how to insert and select data, now lets discuss how to update the existing data in the table. Having learned the select statement it easy top use the Update statement as there is just a slight change in the syntax.
Syntax:
UPDATE <table_name>
SET <column_name_1> = <column_value_1>,
<column_name_2> = <column_value_2>,...
<column_name_N> = <column_value_N>
WHERE <column_name_M> = <value> ;
COMMIT;
Here:
UPDATE: is commend for updating the data
SET: is the keyword for setting the value for the column
Update is used quite similar to the Select statement and joins (discussed in joins) can also be used with the update statement as with select.
Syntax:
UPDATE <table_name>
SET <column_name_1> = <column_value_1>,
<column_name_2> = <column_value_2>,...
<column_name_N> = <column_value_N>
WHERE <column_name_M> = <value> ;
COMMIT;
Here:
UPDATE: is commend for updating the data
SET: is the keyword for setting the value for the column
Update is used quite similar to the Select statement and joins (discussed in joins) can also be used with the update statement as with select.
ada poda
ReplyDelete