Which of the following SQL commands is used to modify existing data in a…

2019

Which of the following SQL commands is used to modify existing data in a database table?

Answer: D. UPDATEConceptA data-manipulation command changes the contents of rows, whereas a data-definition command changes the structure of a table. In SQL, UPDATE is the…

  1. A.

    MODIFY

  2. B.

    CHANGE

  3. C.

    NEW

  4. D.

    UPDATE

Attempted by 1 students.

Show answer & explanation

Correct answer: D

Concept

A data-manipulation command changes the contents of rows, whereas a data-definition command changes the structure of a table.

In SQL, UPDATE is the statement for assigning new values to columns of existing rows. Its core form is UPDATE table_name SET column_name = value, with an optional WHERE condition.

Application

Apply the command definition to this item:

  1. Identify the target operation: values in rows already stored in a table must change.

  2. Choose the SQL data-manipulation statement designed for that operation: UPDATE.

  3. Use SET to specify the new column value and WHERE to limit the affected rows, for example: UPDATE employees SET salary = 50000 WHERE id = 7.

Contrast

  • MODIFY is a general verb and also appears in some vendor-specific schema-alteration syntax; it is not the data-manipulation statement required here.

  • CHANGE is an everyday synonym and a vendor-specific column-definition keyword in some systems; it does not name the required standard data-change statement.

  • NEW describes a prospective value or row image in some database contexts; it does not perform the operation.

  • UPDATE is the SQL data-manipulation statement that assigns new values to columns of existing rows.

Cross-check

The PostgreSQL command reference defines UPDATE as changing specified column values in rows that satisfy a condition, which matches the operation in the stem.

Result

Therefore, the required command is UPDATE.

Explore the full course: Uppsc Computer Operator Grade B

Loading lesson…