Difficulty: Easy
Correct Answer: Correct
Explanation:
Introduction / Context:
Surrogate keys are system-generated identifiers that uniquely identify rows. In MySQL, AUTO_INCREMENT is a common mechanism for producing such numeric keys without client-side generation.
Given Data / Assumptions:
Concept / Approach:
Using AUTO_INCREMENT simplifies key management and avoids collisions. It is distinct from natural keys and from GUID/UUID strategies. AUTO_INCREMENT may have configuration nuances (increment step, starting value, behavior under replication).
Step-by-Step Solution:
Define a table with id INT PRIMARY KEY AUTO_INCREMENT.Insert rows without specifying id.Retrieve generated values via LAST_INSERT_ID().Adjust starting values with ALTER TABLE ... AUTO_INCREMENT = n.Consider uniqueness and gaps under rollbacks or deletes.
Verification / Alternative check:
Run sample DDL/DML and observe increasing identifiers.
Why Other Options Are Wrong:
Support is not limited to legacy engines or versions; modern MySQL/InnoDB support this feature robustly.
Common Pitfalls:
Assuming sequential without gaps; relying on order semantics of generated values.
Final Answer:
Correct
Discussion & Comments