How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons table?
-
MODIFY Persons SET LastName='Nilsen' WHERE LastName='Hansen'
-
MODIFY Persons SET LastName='Hansen' INTO LastName='Nilsen
-
UPDATE Persons SET LastName='Hansen' INTO LastName='Nilsen'
-
UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'
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.
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.