# Writing SQL Queries

## SQL-Dialect

The SQL dialect used is **Postgres**. You can find a detailed description of how to create queries here: <https://www.postgresql.org/docs/current/queries.html>.

{% hint style="warning" %}
In PostgreSQL **unquoted names are case-insensitive**. This means that `SELECT * FROM mytable` and `SELECT * FROM myTable` are equivalent and both tables are interpreted as `mytable`.

However, **quoted names are case-sensitive**. So in case there is any casing in either your table or column names you should use quotes, e.g. `SELECT * FROM "myTable"`.
{% endhint %}

## Available Functions

Following the the available functions and autocomplete terms that you can use inside your SQL queries

* \#>
* \#>>
* $end\_date
* $start\_date
* \*
* ->
* ->>
* ::
* <
* \>
* AND
* AS
* ASC
* AVG
* BTRIM
* CASE
* CAST
* COALESCE
* CONCAT
* CONCAT\_WS
* COUNT
* CURRENT\_DATE
* DATE
* DATE\_PART
* DATETRUNC
* DESC
* DISTINCT
* ELSE
* END
* FALSE
* FLOAT
* FROM
* FULL OUTER JOIN
* GENERATESERIES
* GROUP BY
* IFNULL
* ILIKE
* INITCAP
* INNER JOIN
* INT
* INTERVAL
* JSON
* LEFT OUTER JOIN
* LEFT
* LENGTH
* LIKE
* LIMIT
* LOWER
* LPAD
* LTRIM
* NOT ILIKE
* NOT LIKE
* NULL
* ON
* OR
* ORDER BY
* REGEXP\_MATCHES
* REGEXP\_REPLACE
* REPEAT
* REPLACE
* REVERSE
* RIGHT OUTER JOIN
* RIGHT
* RPAD
* RTRIM
* SELECT
* SPLIT\_PART
* SUBSTRING
* SUM
* TEXT
* THEN
* TIMESTAMP
* TRUE
* UNION ALL
* UNION
* UPPER
* WHEN
* WHERE
