SQL Tutorial

20 / 68

Updating data in a table

Values of one or more columns of a table can be updated with the 'update' command to store new required values.

Syntax:

update table_name SET field1 = new-value1, field2 = new-value2
[where Clause]

Example:

update deptt
set depcity = 'Pune' where depstreet = 'Laker Street';
update deptt
set depopendate = STR_TO_DATE('20170610','%Y%m%d'), depstreet = 'Saker Street' where depcity = 'Mumbai' order by depid desc limit 1;
select * from deptt ;

No hints are availble for this assesment

Answer is not availble for this assesment

Loading comments...