Question 1
AdvancedUse DDL to manage tables and their relationships · Use CREATE TABLE statements
A database consultant is designing a schema for a new inventory system. The system requires a table to store product categories where each category must have a unique numeric identifier that is automatically generated by the database upon insertion. The identifier should not allow gaps if the database restarts, even at the cost of performance. Which DDL strategy fulfills this requirement?
Answer and explanation
Correct answer: D
To prevent gaps caused by caching during database restarts, the NOCACHE option must be used. The ORDER option ensures values are generated in order of request. GENERATED ALWAYS AS IDENTITY creates an internal sequence to populate the column automatically.
