Fantastic! You already know how to insert data with
NULLs. You can also use
Suppose the teacher made a mistake. Tom Muller took the written exam, but the teacher hasn't checked this exam (exam ID of
17). Nevertheless, Tom has the score of the written exam (
written_exam_score) and the date (
written_score_date), but he shouldn't. In this case, the only known value is the actual date of the written exam; you must remove the other two values. How would you do this?
It's simple! Look at the command below:
written_exam_score = NULL,
written_score_date = NULL
WHERE id = 17;
SET, we used two comma-separated column names to update
written_score_date. Each column was assigned
NULL. In the
WHERE condition, we update only the exam with
id = 17. In this way, we correct our mistake.