Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

. Create a sequence that generates integers starting with the value 5. Each valu

ID: 3535412 • Letter: #

Question

. Create a sequence that generates integers starting with the value 5. Each value should be three less than the previous value generated. The lowest possible value should be 0, and the sequence shouldn’t be allowed to cycle. Name the sequence MY_FIRST_SEQ.


This is as far as I got


CREATE SEQUENCE MY_FIRST_SEQ_seq
INCREMENT BY 1
START WITH 5

NO CACHE
NO CYCLE

Explanation / Answer

SQL> ed Wrote file afiedt.buf 1 create sequence reverse_seq 2 start with 15 3 increment by -3 4 maxvalue 16 5* minvalue -1 SQL> / Sequence created. SQL> select reverse_seq.nextval from dual; NEXTVAL ---------- 15 SQL> / NEXTVAL ---------- 12 SQL> / NEXTVAL ---------- 9 SQL> / NEXTVAL ---------- 6 SQL> / NEXTVAL ---------- 3 SQL> / NEXTVAL ---------- 0