Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CREATE SEQUENCE customer_seq START WITH 1021 INCREMENT BY 1 NOCYCLE NOCACHENOMINVALUE NOMAXVALUE;Sequence created.2.Insert into CUSTOMERS (customer#, lastname, frstname, zip) Values (customer_seq.NEXTVAL,'SHOULDERS', 'FRANK', '23567');1 row(s) inserted.3.CREATE

CREATE SEQUENCE customer_seq START WITH 1021 INCREMENT BY 1 NOCYCLE NOCACHENOMINVALUE NOMAXVALUE;Sequence created.2.Insert into CUSTOMERS (customer#, lastname, frstname, zip) Values (customer_seq.NEXTVAL,'SHOULDERS', 'FRANK', '23567');1 row(s) inserted.3.CREATE SEQUENCE MY_FIRST_SEQ INCREMENT BY -3 START WITH 5 MAXVALUE 5 MINVALUE 0NOCYCLE;Sequence created.4.select MY_FIRST_SEQ.NEXTVAL rom dual;5select MY_FIRST_SEQ.NEXTVAL rom dual;2select MY_FIRST_SEQ.NEXTVAL rom dual;ORA-08004 (goes below MINVALUE)5.ALTER SEQUENCE my_frst_seq MINVALUE -1000;Sequence altered.6.CREATE TABLE Email_Log (emailid NUMBER (10), emaildate DATE, customer# NUMBER (10),CONSTRAINT emailid_pk PRIMARY KEY (emailid));Table created.CREATE SEQUENCE idnumber_seq INCREMENT BY 1 START WITH 1000 NOMINVALUENOMAXVALUE NOCACHE NOCYCLE;Sequence created.INSERT INTO Email_Log (emailid, emaildate, customer#) VALUES (idnumber_seq.NEXTVAL,SYSDATE, 1007);1 row(s) inserted.INSERT INTO Email_Log (emailid, emaildate, customer#) VALUES (DEFAULT, SYSDATE, 1008);

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions