Which SQL command is used to modify existing records in a database?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Study for the OCR GCSE Computer Science Exam. Prepare with flashcards, multiple choice questions, and hints. Get exam-ready with practical questions and answers!

The SQL command used to modify existing records in a database is UPDATE. This command allows you to change the values of one or more columns in a table for the rows that meet certain criteria. By specifying the table to update, the columns to modify, and the conditions for which rows to affect, the UPDATE command provides a flexible way to manage and manipulate data stored within a database.

For example, if you want to change the email address of a specific user in a user table, you would use the UPDATE command followed by the SET clause to define the new value and a WHERE clause to specify which user's record should be modified.

The other options serve different purposes: INSERT INTO is used for adding new records to a table, CREATE TABLE creates a new table in a database, and ORDER BY is employed to sort the result set of a SELECT statement based on one or more columns. Each of these commands plays an important role in database management but does not modify existing data like the UPDATE command does.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy