What are sequences? Explain with syntax.
A field in oracle can be kept as auto incremented by using sequence. it can be used to create a number sequence.
Syntax:CREATE SEQUENCE sequence_name
MINVALUE value
MAXVALUE value
START WITH value
INCREMENT BY value
CACHE value;
Example: employee_seq will cache up to 20 values for performance. Starts from one.
CREATE SEQUENCE employee_seq
MINVALUE 1
MAXVALUE 999999999999999999999999999
START WITH 1
INCREMENT BY 1
CACHE 20;