thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Data & Analytics · Intermediate

Sequence

A standalone database object that generates unique numbers on request, independent of any one table.

Definition

Sequences (CREATE SEQUENCE) provide NEXTVAL and can be shared across tables and sessions. They can cache values for performance, which may produce gaps. Oracle used sequences for surrogate keys before identity columns existed.

Example

INSERT INTO Orders (ID, ...) VALUES (order_seq.NEXTVAL, ...);

Exam tip

A sequence is a separate object usable by many tables; an identity column is tied to one column.

Related terms