<commit_before># SQL - CREATE SEQUENCE 

(Since v2.2)

Creates a new sequence.

## Syntax

```sql
CREATE SEQUENCE <sequence> [TYPE <CACHED|ORDERED>] [START <start>] [INCREMENT <increment>] [CACHE <cache>]
```

Where:
- `sequence` is the sequence name to create
- `TYPE` can be:
 - `CACHED`, where each call to the `.next()` will result in a new value
 - `ORDERED`, where the sequence will cache N items on each node, thus improving the performance if many `.next()` calls are required. However, this may create holes with numeration
- `start` set the initial value of the sequence
- `increment` set the value to increment when `.next()` is called
- `cache` set the number of values to pre-cache in case the sequence is of type CACHED

## See also
- [SQL Alter Sequence](SQL-Alter-Sequence.md)
- [SQL Drop Sequence](SQL-Drop-Sequence.md)
- [Sequences and auto increment](Sequences-and-auto-increment.md)

## Examples

### Create and use a new sequence to handle id numbers

```sql
CREATE SEQUENCE idseq
INSERT INTO account SET id = sequence('idseq').next()
```

To know more about other SQL commands look at [SQL commands](SQL).
<commit_msg>Update SQL-Create-Sequence.md<commit_after># SQL - CREATE SEQUENCE 

(Since v2.2)

Creates a new sequence.

## Syntax

```sql
CREATE SEQUENCE <sequence> TYPE <CACHED|ORDERED> [START <start>] [INCREMENT <increment>] [CACHE <cache>]
```

Where:
- `sequence` is the sequence name to create
- `TYPE` can be:
 - `CACHED`, where each call to the `.next()` will result in a new value
 - `ORDERED`, where the sequence will cache N items on each node, thus improving the performance if many `.next()` calls are required. However, this may create holes with numeration
- `start` set the initial value of the sequence
- `increment` set the value to increment when `.next()` is called
- `cache` set the number of values to pre-cache in case the sequence is of type CACHED

## See also
- [SQL Alter Sequence](SQL-Alter-Sequence.md)
- [SQL Drop Sequence](SQL-Drop-Sequence.md)
- [Sequences and auto increment](Sequences-and-auto-increment.md)

## Examples

### Create and use a new sequence to handle id numbers

```sql
CREATE SEQUENCE idseq TYPE ORDERED
INSERT INTO account SET id = sequence('idseq').next()
```

To know more about other SQL commands look at [SQL commands](SQL).

{'fraction_non_alphanumeric': 0.11400086692674469, 'fraction_numerical': 0.0017338534893801473, 'mean_word_length': 4.305747126436781, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4013986', 'n_tokens_mistral': 722, 'n_tokens_neox': 686, 'n_words': 309}