We are already learnt how to select data from the database and how to insert data into the database
using keywell to update data that are already in the database.
We use the update statement.
We start an update statement in esky well with the stop date key word followed by the name of the table.
Then we add the set word followed by a column name and the value we want to set it to.
We can update several columns in one statement by listing several columns and then new values separated
by commas.
Finally we optionally add a weather condition to only update records that match this condition.
This condition is specified in the same way we add conditions to a select statement.
Let's give this a try these other current records in our article table.
Let's update the title of the rijkaard with an idea of sex.
One row was affected and there we can see the updated rijkaard.
We've got two cards with the same title of an interesting post
the update statement Will update any rows that match the WHERE clause.
So with this esky Well the where clase will match those two records.
So those will be updated.
And there we can see the updated records.
Dont forget.
As with the select statement.
Any columns that you use in the WHERE clause should have an index.
Otherwise they could take a long time to execute.
One more thing about the update statement.
If you don't include aware class every single row in the table will be updated.
So unless you actually want to do this make sure you always include a WHERE clause to only update the
records that you want to change.