60.3k views
2 votes
Which is the best approach to update the last name of the student Donette Figgins to Smith?

a) UPDATE Students SET LastName = 'Smith' WHERE LastName = 'Donette Figgins';
b) MODIFY Students SET LastName = 'Smith' WHERE LastName = 'Donette Figgins';
c) ALTER Students SET LastName = 'Smith' WHERE LastName = 'Donette Figgins';
d) CHANGE Students SET LastName = 'Smith' WHERE LastName = 'Donette Figgins';

User Lwalden
by
8.0k points

1 Answer

3 votes

Final answer:

To update the last name of a student, use the SQL UPDATE command with the correct identification of the student in the WHERE clause. None of the provided options are correct; the correct SQL syntax should include both the first and last names to accurately target the student's record.

Step-by-step explanation:

The approach to correctly update the last name of a student in a database is through an SQL statement that uses the UPDATE command. The correct command in this case would be:

UPDATE Students SET LastName = 'Smith' WHERE FirstName = 'Donette' AND LastName = 'Figgins';

You should specify both the first name and last name in the WHERE clause to ensure that you are updating the correct record, especially if the database could have multiple entries with the same last name. Note that none of the provided options are correct, as they either use the wrong SQL command or do not correctly specify the student's full name in the WHERE clause.

User Nanhydrin
by
7.9k points