;). Each command is composed of a sequence of tokens. Tokens can be keywords, identifiers, literals, operators, or special characters. Tokens are normally separated by whitespace (spaces, tabs, newlines), but need not be if there is no ambiguity.
Identifiers
Identifiers are names used to refer to database objects such as tables, columns, views, indexes, and engines. For detailed rules about identifier syntax and naming requirements, see Object identifiers.Key rules
Identifiers must contain at least one character and no more than 255 characters. Unquoted identifiers:- Must begin with a letter (a-z) or underscore (
_) - Subsequent characters can be letters, underscores, or digits (0-9)
- Are case-insensitive and evaluated entirely in lowercase
- Are enclosed in double quotes (
") - Can contain any UTF-8 characters, including spaces and special characters
- Are case-sensitive
Reserved words
Certain words are reserved by the SQL language and cannot be used as unquoted identifiers. If you need to use a reserved word as an identifier, enclose it in double quotes. For a complete list, see Reserved words.Literals
Literals (also called constants) are fixed data values written directly in SQL statements.String literals
String literals are enclosed in single quotes ('). To include a single quote within a string, write two adjacent single quotes.
Dollar-quoted string literals
For strings containing single quotes, newlines, or other special characters, you can use dollar-quoted strings. These are enclosed by$$ markers and do not require escaping.
Escape string literals
Escape string literals are prefixed with the letterE (case-insensitive) before the opening single quote. They support backslash escape sequences for special characters.
Any other character following a backslash is taken literally.
For compatibility, the
standard_conforming_strings setting can be set to false to make regular string literals also recognize backslash escape sequences. However, using E'' syntax is recommended for clarity.Numeric literals
Numeric literals represent integer and floating-point values. Integer literals:Boolean literals
Boolean literals represent true or false values.NULL literal
TheNULL literal represents a missing or unknown value.
Date and time literals
Date and time literals can be written using the type name followed by a string literal, or by casting a string. DATE literals:Interval literals
Interval literals represent a duration of time and are used in date/time arithmetic. Intervals must be used as part of an arithmetic expression with a date or timestamp value.Array literals
Array literals are enclosed in square brackets with elements separated by commas.STRUCT literals
STRUCT literals are written using theSTRUCT keyword.
Rows: 1Execution time: 41.01ms
Type casting
Literals can be cast to specific data types using the:: operator, the CAST function, or type name prefix syntax.
Operators
Operators are special symbols or keywords that perform operations on values. Firebolt supports arithmetic, comparison, logical, string, and other operators.Comments
Comments are used to add notes or temporarily disable portions of SQL code. Firebolt supports two styles of comments.Single-line comments
Single-line comments begin with two dashes (--) and extend to the end of the line.
Block comments
Block comments begin with/* and end with */. They can span multiple lines.
Query parameters
Firebolt supports parameterized queries using positional placeholders ($1, $2, $3, etc.). Parameters allow you to write query templates and supply values at execution time.
- Security: Prevents SQL injection by separating query logic from data
- Reusability: The same query template can be executed with different values