7 MySql Update
7 MySql Update
Query
Language
UPDATE
There may be a
requirement where the
existing data in a MySQL
table needs to be modified.
You can do so by using the
SQL UPDATE command.
This will modify any field
value of any MySQL table.
To add 5 marks in
physics whose roll is
5
To add 5 marks in
physics whose roll is
5
To delete the physics
marks of komal
Delete the physics
marks of komal
To delete the chemistry
marks of all students
whose name starts with
“k”
To delete the chemistry
marks of all students
whose name starts with
“k”
Note: Be careful when
updating records in a
table! Notice
the WHERE clause in
the UPDATE statement.
The WHERE clause
specifies which record(s)
that should be updated. If
you omit
Update without where claus
Assign 16 in
chemistry to those
students whose
marks in chemistry is
null
Assign 16 in
chemistry to those
students whose
marks in chemistry is
null
Make Chem NULL whose phy is NULL
Add 5 more in
physics whose marks
in chemistry is more
than 17
Add 5 marks in
chemistry and
subtract 3 marks
from physics whose
name ends with “n”