Oops… the English teacher just realized that she accidentally switched
OralExamScores. The last
UPDATE introduced another mistake to the
Exam table, again with all records for English exams. The values of the
WrittenExamScore column got swapped with those of the
OralExamScore column. How can we correct this? Look at the query below:
SET WrittenExamScore = OralExamScore,
OralExamScore = WrittenExamScore
WHERE Subject = N'English'
We set new values for two columns:
OralExamScore. The first column took the value from
OralExamScore, and the second column took the value from
WrittenExamScore. T-SQL makes this operation easy.