Oracle Database SQL — Question 200
Which statement will return the last sequence number generated by the EMP_SEQ sequence?
Answer options
- A. SELECT CURRVAL FROM emp_seq;
- B. SELECT emp_seq.CURRVAL FROM DUAL;
- C. SELECT NEXTVAL FROM emp_seq;
- D. SELECT emp_seq.NEXTVAL FROM DUAL;
Correct answer: B
Explanation
The correct answer is B because it correctly uses CURRVAL to get the last generated value of the sequence from the DUAL table. Option A is incorrect as it does not specify the sequence name correctly. Option C retrieves the next value instead of the current one, and option D does the same as C, which is not what is being asked.