Multiple choice technology databases

How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons table?

  1. MODIFY Persons SET LastName='Nilsen' WHERE LastName='Hansen'

  2. MODIFY Persons SET LastName='Hansen' INTO LastName='Nilsen

  3. UPDATE Persons SET LastName='Hansen' INTO LastName='Nilsen'

  4. UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

SQL uses the UPDATE statement with SET clause to modify data. Option D has the correct syntax: UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'. The SET clause specifies the new value, and WHERE identifies which rows to update. Options A, B, and C all use MODIFY keyword which doesn't exist in SQL, or have incorrect INTO syntax.

AI explanation

SQL's UPDATE statement modifies existing rows using the pattern UPDATE table SET column=newvalue WHERE condition, so changing "Hansen" to "Nilsen" requires UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'. There is no MODIFY statement in standard SQL, and INTO is not part of UPDATE syntax — that keyword belongs to INSERT INTO or SELECT INTO.