Question 1
A sequence is a database/schema object used to generate a unique auto-number. The auto-number generated through a sequence is independent of tables, which means that the same number can be used for multiple tables.
Create a Sequence named Supplier_Seq which generate an auto-number for the Supplier_ID column of the following table.
Supplier_ID Supplier_Name Contact_No Country_Name
Note: The sequence should start with the number 202, each sequence number must be even, for faster access, the CACHE value should be 20 and there should be no cycle in the sequence.
CREATE SEQUENCE Supplier_Seq
START WITH 202
INCREMENT BY 2
MINVALUE 200
MAXVALUE 1000
CACHE 20
NOCYCLE;
Comments
Leave a comment