<commit_before>---
layout: docs
title: SQL² Reference
permalink: /docs/sqlreference/
docs_navbar: true
---

SQL² is a subset of ANSI SQL, designed for queries into SQL relational databases.
SQL² has support for every major SQL SELECT clause, such as AS, WHERE, JOIN,
GROUP BY, HAVING, LIMIT, OFFSET, CROSS, etc. It also contains many standard
SQL functions and operators. It follows [PostgreSQL](http://www.postgresql.org/)
where SQL dialects diverge.

This reference contains the following sections:

* Data Types
* Clauses, Operators, and Functions
* Basic Selection
* Filtering a Result Set
* Numeric and String Operations
* Dates and Times
* Grouping
* Nested Data and Arrays
* Pagination and Sorting
* Joining Collections
* Conditionals and Nulls
* Specific Database Considerations
{:toc}


## Data Types

The following data types are used by SQL².

**Note:** Some data types are not natively supported by all databases.
Instead, they are emulated by SlamData, meaning that you can use them
as if they were supported by the database.

### MongoDB Data Types

| Type | Description | Examples | MongoDB native-supported |
| ---- | ----------- | -------- | ------------------------ |
| Null | Indicates missing information. | `null` | Yes |
| Boolean | true or false | `true`, `false` | Yes |
| Integer | Whole numbers (no fractional component) | `1`, `-2`  | Yes |
| Decimal | Decimal numbers (optional fractional components) | `1.0`, `-2.19743` |Yes |
| String | Text | `'221B Baker Street'` | Yes |<commit_msg>Testing Table of contents for Jekyll<commit_after>---
layout: docs
title: SQL² Reference
permalink: /docs/sqlreference/
docs_navbar: true
---

SQL² is a subset of ANSI SQL, designed for queries into SQL relational databases.
SQL² has support for every major SQL SELECT clause, such as AS, WHERE, JOIN,
GROUP BY, HAVING, LIMIT, OFFSET, CROSS, etc. It also contains many standard
SQL functions and operators. It follows [PostgreSQL](http://www.postgresql.org/)
where SQL dialects diverge.

This reference contains the following sections:

{:toc}

## Data Types

The following data types are used by SQL².

**Note:** Some data types are not natively supported by all databases.
Instead, they are emulated by SlamData, meaning that you can use them
as if they were supported by the database.

### MongoDB Data Types

| Type | Description | Examples | MongoDB native-supported |
| ---- | ----------- | -------- | ------------------------ |
| Null | Indicates missing information. | `null` | Yes |
| Boolean | true or false | `true`, `false` | Yes |
| Integer | Whole numbers (no fractional component) | `1`, `-2`  | Yes |
| Decimal | Decimal numbers (optional fractional components) | `1.0`, `-2.19743` |Yes |
| String | Text | `'221B Baker Street'` | Yes |
{'fraction_non_alphanumeric': 0.12938200216841345, 'fraction_numerical': 0.0093964582580412, 'mean_word_length': 3.5526315789473686, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7351678', 'n_tokens_mistral': 814, 'n_tokens_neox': 770, 'n_words': 348}