Using the Update query
The Update query will modify one or more stored entities. This query is used to modify the content of a data store. It specifies the fields of the entity to be modified, their new values and which entities to be affected.
The Update query normally will include the
Update clause, a
Set clause and a
Where clause. The
Update clause is similar in structure to a
Select clause, but uses the UPDATE keyword instead. The
Set clause follows and starts with the SET keyword and has an assignment looking expression. The
Where clause follows the
For example, to update the dosage for a specific type of mediation we can use this query:
UPDATE Medication m SET m.dosage = 6 WHERE m.type = 'ACE'
Update clause specifies ...