Prepare for the A Level Computer Science OCR Exam with engaging quizzes, detailed explanations, and effective study tips. Maximize your readiness and boost your confidence for exam day!

Practice this question and more.


Which SQL command is used to modify existing records?

  1. INSERT

  2. SELECT

  3. UPDATE

  4. DELETE

The correct answer is: UPDATE

The SQL command used to modify existing records in a database is the UPDATE command. This command allows users to change the values of specified fields in one or more records in a table, based on certain conditions. For example, if you want to change the email address of a specific user in a user table, you can use the UPDATE command to set the new email address where the user ID matches. The UPDATE command typically follows the format: ```sql UPDATE table_name SET column1 = value1, column2 = value2, ... WHERE condition; ``` The presence of the WHERE clause is particularly important as it specifies which records should be updated, helping to prevent unintentional modifications to all records in the table. In contrast, other options serve different purposes: - The INSERT command is used to add new records to a table. - The SELECT command retrieves data from a database without making any changes. - The DELETE command removes records from a table rather than modifying them. Hence, UPDATE is the correct command for modifying existing records.