In database operations, which command updates existing rows by changing one or more field values in a record (as opposed to inserting or deleting rows)?

Difficulty: Easy

Correct Answer: UPDATE

Explanation:


Introduction / Context:
CRUD stands for Create, Read, Update, Delete—four fundamental operations in data management. Knowing which command corresponds to each action is essential for both SQL users and application developers who call these operations via ORM or direct queries.



Given Data / Assumptions:

  • We need to change values in existing rows (records) without creating or removing rows.
  • The task targets one or more columns in one or more rows, filtered by a condition.
  • Standard SQL terminology applies.


Concept / Approach:
The SQL statement for modifying existing data is UPDATE. It sets new values for columns, typically with a WHERE clause to target specific rows. INSERT adds new rows. DELETE removes rows. SELECT reads data. Non-SQL verbs like “LOOKUP” describe UI actions, not DML commands.



Step-by-Step Solution:

Identify that changes are to existing records, not creations or deletions. Recall syntax: UPDATE table SET col = value WHERE condition; Confirm that other commands do not change existing rows’ values. Choose UPDATE as the correct command.


Verification / Alternative check:
Any SQL reference shows UPDATE as the canonical operation for changing field values in place.



Why Other Options Are Wrong:

  • INSERT: creates new rows, no change to existing ones.
  • SELECT: retrieves, does not modify.
  • DELETE: removes rows entirely.
  • LOOKUP: not an SQL command; a user-interface concept.


Common Pitfalls:
Omitting the WHERE clause and unintentionally updating all rows; forgetting transactions and rollback plans; not validating inputs leading to unintended data changes.



Final Answer:
UPDATE

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion