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. UPDATE — ConceptA data-manipulation command changes the contents of rows, whereas a data-definition command changes the structure of a table. In SQL, UPDATE is the…
- A.
MODIFY
- B.
CHANGE
- C.
NEW
- 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:
Identify the target operation: values in rows already stored in a table must change.
Choose the SQL data-manipulation statement designed for that operation:
UPDATE.Use
SETto specify the new column value andWHEREto limit the affected rows, for example:UPDATE employees SET salary = 50000 WHERE id = 7.
Contrast
MODIFYis a general verb and also appears in some vendor-specific schema-alteration syntax; it is not the data-manipulation statement required here.CHANGEis an everyday synonym and a vendor-specific column-definition keyword in some systems; it does not name the required standard data-change statement.NEWdescribes a prospective value or row image in some database contexts; it does not perform the operation.UPDATEis 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.