Difficulty: Easy
Correct Answer: ALTER TABLE [TableName].
Explanation:
Introduction / Context:
SQL distinguishes between changing data and changing structure. Data Manipulation Language (DML) statements edit row contents, while Data Definition Language (DDL) statements create or alter schema objects. This question asks which command changes an existing table's structure.
Given Data / Assumptions:
Concept / Approach:
ALTER TABLE is the portable DDL statement used across major SQL databases to modify the definition of an existing table. UPDATE modifies data, not structure. MODIFY TABLE and CHANGE TABLE are not standard SQL commands (though some vendors support ALTER TABLE ... MODIFY COLUMN as a clause).
Step-by-Step Solution:
Verification / Alternative check:
Consult vendor documentation; ALTER TABLE is universally recognized for structural changes, while UPDATE affects rows and should not be used for DDL.
Why Other Options Are Wrong:
UPDATE TABLE: DML for row values, not structure.
MODIFY TABLE / CHANGE TABLE: not standard SQL verbs; vendors use ALTER TABLE with MODIFY or CHANGE as subclauses, not as the main command.
Common Pitfalls:
Attempting to use non-portable syntax across engines; forgetting to consider locking and online options during ALTER operations on large tables.
Final Answer:
ALTER TABLE [TableName].
Discussion & Comments