Relational Table - Sequence

Data System Architecture

About

A sequence is a auxiliary relational data structure that maintains a sequence.

Relational sequences are generally used to create a generated primary key via an incremental number.

Transparency usage

They may also be used transparently when a auto-increment instruction in SQL is given on a column

For example with SQlite:

CREATE TABLE foo (
  id INT autoincrement, 
  description TEXT
);

Query

Database may give you the possibility to query the actual or next value of a sequence.

Example with an Oracle sequence.

select my_sequence.nextval from dual;

Database implementation

  • IDENTITY in SQL Server
  • SEQUENCE/NEXTVAL in Oracle
  • AUTOINCREMENT in Access, SQlite

Number to text and id protection





Discover More
JSON - ObjectId

ObjectId are generated identifier (known as surrogate) with the intent to be unique for a Json. ObjectId are custom UUID that are created from: a counter timestamp (milliseconds) node id (IP...
Data System Architecture
Logical Data Modeling - Id attribute

An id is an label attribute with a numeric representation that identify uniquely an entity or a relationship in a local scope. name If the id attribute is chosen as the local identifier, it will be:...
Data System Architecture
RDBMS - Auxiliary Data Structure (ADS)

Auxiliary data structures are logical replications of data from one or more columns of a table. Auxiliary data structures contain copies of, references to, or data computed from base table data, deleting...
Sqlite Banner
Sqlite - Sequence

sqlite offers sequence via the auto-increment feature but does not recommend it. You can see the sequence via the sqlite_sequence...
Data System Architecture
Surrogate (Sequence, GUID) vs Natural key (Business Key)

What's the best choice of data for your primary key ?
Data System Architecture
What is a Surrogate Primary key? known also as Substitute, Synthetic or Generated Key - Logical Data Modeling -

A surrogate key is a substitute primary key for when: the data entity are created in distributed way you don't have access to a central entity such as database to create a simple sequence you don't...



Share this page:
Follow us:
Task Runner