Oracle Database SQL — Question 238
Examine this list of requirements for a sequence:
1. Name: EMP_SEQ
2. First value returned: 1
3. Duplicates are never permitted.
4. Provide values to be inserted into the EMPLOYEES.EMPLOYEE_ID column.
5. Reduce the chances of gaps in the values.
Which two statements will satisfy these requirements? (Choose two.)
Answer options
- A. CREATE SEQUENCE emp_seq START WITH 1 INCREMENT BY 1 CYCLE;
- B. CREATE SEQUENCE emp_seq START WITH 1 INCREMENT BY 1 CACHE;
- C. CREATE SEQUENCE emp_seq;
- D. CREATE SEQUENCE emp_seq START WITH 1 INCREMENT BY 1 NOCACHE;
- E. CREATE SEQUENCE emp_seq NOCACHE;
- F. CREATE SEQUENCE emp_seq START WITH 1 CACHE;
Correct answer: D, E
Explanation
The correct options D and E both ensure that the sequence starts at 1 and does not allow gaps by using NOCACHE, which prevents caching of sequence values and guarantees that each call will generate a new value. Options A, B, and F include caching, which can lead to gaps in the sequence values, while option C lacks the necessary specifications to meet the requirements.