From braindump
Jump to: navigation, search

{{#set:Related SQL command=INSERT|Related SQL command=DELETE|Related SQL command=SELECT}}

UPDATE is refers to the SQL command UPDATE.


The UPDATE command is used to update existing records in a table. Syntax may vary between certain types of databases but is generally uniform across multiple vendors.


  UPDATE <table> 
    SET <column> = <value> [, <column> = <value>] [, ...]]
    [ WHERE <condition> ]


To update the value from "foo" to "foobar" in column "bar" in table "baz" do the following:

  INSERT INTO baz ( bar ) VALUES( "foo" )
  UPDATE baz SET bar = "foobar" WHERE bar = "foo" 

Note: This will udpdate all the instances where bar has a value of "foo" to "foobar"


  1. Use the sample database and insert and populate it with the data from the [[File::/etc/shadow]].

Additional Information