Good job! So far, we've always inserted fixed values when updating data. However, when we update, we can also refer to values from another column.
Suppose someone has found mistakes made in the scoring of written and oral English exams. Say that each written English exam score needs four points added to it and each oral English exam score is actually six points less than the written exam score. Here's the statement to correct this mistake:
written_exam_score = written_exam_score + 4,
oral_exam_score = written_exam_score - 6
WHERE subject = 'English'
SET command, we assigned to the
written_exam_score column its current value plus 4 points. Similarly, we updated the
oral_exam_score column, only we subtracted six points from the written exam score (we took the value from
written_exam_score). In the
WHERE clause, we limited this
UPDATE operation to exams for English.