Instruction
Oops… the English teacher just realized that she accidentally switched WrittenExamScores and 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:
UPDATE Exam SET WrittenExamScore = OralExamScore, OralExamScore = WrittenExamScore WHERE Subject = N'English'
We set new values for two columns: WrittenExamScore and OralExamScore. The first column took the value from OralExamScore, and the second column took the value from WrittenExamScore. T-SQL makes this operation easy.
Exercise
It's time to fix another mistake in our database. Somebody mistook the first name of the student whose ID is 6 for his last name. See if you can use the example query to correct this.



