Difficulty: Easy
Correct Answer: Rows can be inserted one at a time or in groups (using INSERT ... SELECT)
Explanation:
Introduction / Context:
SQL provides flexible ways to add data to tables. Knowing the variations helps with performance, ETL tasks, and application simplicity.
Given Data / Assumptions:
Concept / Approach:
INSERT supports two common modes: row-at-a-time with VALUES, and set-based with INSERT ... SELECT, which can insert many rows in one statement. The choice affects performance and transaction behavior. It is not limited to one row per statement, and it is perfectly valid to copy rows from other tables or views via SELECT.
Step-by-Step Solution:
Verification / Alternative check:
Examples: INSERT INTO t(col1,col2) SELECT a,b FROM src WHERE ...; or INSERT INTO t VALUES (1,'a'), (2,'b') in systems that allow multi-values.
Why Other Options Are Wrong:
Only modify / cannot copy: Confuses INSERT with UPDATE; copying via SELECT is standard.
Only one at a time: Not true for INSERT ... SELECT (and multi-VALUES in many RDBMS).
Requires values for every column: Column lists and defaults/NULLs allow partial inserts.
Common Pitfalls:
For large batch inserts, remember to manage constraints and indexes to maintain performance and integrity.
Final Answer:
Rows can be inserted one at a time or in groups (using INSERT ... SELECT)
Discussion & Comments