1 Create a sequence for populating the Customer column of th

1. Create a sequence for populating the Customer# column of the CUSTOMERS table When setting the start and increment values, keep in mind that data already exists in this table

Solution

Query 1:
CREATE SEQUENCE customer_seq
NOMAXVALUE
NOMINVALUE
INCREMENT BY 1
NOCACHE
NOCYCLE;
  

  
Query 2:
INSERT INTO CUSTOMERS(Customer#,last_name,first_name,zip) VALUES (customer_seq.NEXTVAL,\"Shoulders\",\"Frank\",23567)

Query 3:
CREATE SEQUENCE MY_FIRST_SEQ
START WITH 5
INCREMENT BY -3
MINVALUE 0
NOCACHE
NOCYCLE;
  

  
Query 4:
SELECT MY_FIRST_SEQ.NEXTVAL FROM DUAL
Output : 5

SELECT MY_FIRST_SEQ.NEXTVAL FROM DUAL
Output : 2

SELECT MY_FIRST_SEQ.NEXTVAL FROM DUAL
Output : Error as value is less than minimum value specified

Query 5:
ALTER SEQUENCE MY_FIRST_SEQ
   MINVALUE -1000

 1. Create a sequence for populating the Customer# column of the CUSTOMERS table When setting the start and increment values, keep in mind that data already exi

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site