This glossary provides a quick, comprehensive reference for commonly used SQL functions and keywords. Each term includes a concise description to clarify its purpose and typical usage within queries. Whether you're writing SQL, validating data, or working through complex transformations, this glossary serves as a practical lookup tool to streamline your workflow and improve accuracy.
Query Syntax
Overview
[ WITH ... ]
SELECT
...
FROM
...
[ WHERE ... ]
[ GROUP BY ... ]
[ HAVING ... ]
[ QUALIFY ... ]
[ ORDER BY ... ]
[ LIMIT ... ]
Datatypes
For complete details on each data type, see the Data Types reference.
| Type | Description |
|---|---|
VARCHAR | Variable-length character string |
TEXT | Text data (treated as string) |
INT/INTEGER | Integer (whole numbers) |
FLOAT | Floating-point number (64-bit inexact) |
DECIMAL | Precise decimal number (up to 38 digits) |
BOOLEAN | True/false value |
DATE | Calendar date (YYYY-MM-DD) |
TIMESTAMP | Date and time (YYYY-MM-DD HH:MM:SS) |
ARRAY | Ordered collection of values |
JSON | Semi-structured JSON data |
VARIANT | Flexible type for heterogeneous data |
NULL | Represents missing or unknown values |
Joins
| Function/Keyword | Description |
|---|---|
| CROSS JOIN | Returns the Cartesian product of two tables |
| INNER JOIN | Returns records with matching values in both tables |
| JOIN | Combines rows from two or more tables based on a related column |
| LEFT JOIN | Returns all records from the left table and matched records from the right |
| ON | Specifies the condition for a join operation or a function |
| USING | Specifies columns for equijoins |
Conditionals & Logic
| Function/Keyword | Description |
|---|---|
| AND | Combines multiple conditions, returning TRUE if all are true |
| ANY | Checks if any element in a set satisfies a condition |
| BETWEEN | Filters results within a range of values |
| CASE | Implements conditional logic, returning different results based on conditions |
| COALESCE | Returns the first non-null value in a list of arguments |
| DECODE | Compares an expression to search values and returns the matching result. DECODE(...) is accepted in Rippling SQL; the parser normalizes it to CASE during conversion. |
| EXISTS | Tests whether a subquery returns any rows. |
| IFF | A conditional function that returns one of two values based on a boolean expression |
| IFNULL | Returns the first non-null value: expression when it is not NULL, otherwise fallback. Accepted COALESCE-style alias (parser normalizes to COALESCE). |
| ILIKE | Case-insensitive version of LIKE |
| IN | Checks if a value exists within a list of values or subquery |
| IS NULL | Checks for NULL values |
| LIKE | Searches for a specified pattern in a column |
| NOT | Negates a condition |
| NULLIF | Returns NULL if expression1 is equal to expression2, otherwise returns expression1 |
| NVL | Returns the first non-null value: expression when it is not NULL, otherwise fallback. Accepted COALESCE-style alias (parser normalizes to COALESCE). |
| OR | Combines multiple conditions, returning TRUE if at least one is true |
Clauses & Keywords
| Function/Keyword | Description |
|---|---|
| AS | Assigns an alias to a column or table |
| DESC | Specifies descending order for sorting |
| DISTINCT | Eliminates duplicate rows from the result set or used with aggregate functions to return unique values |
| EXCEPT | Returns the rows that are in the result set of the first query, but not the second |
| FROM | Specifies the table or view from which to retrieve data or the source of data within a function |
| GROUP BY | Groups rows sharing a property for aggregate functions |
| LIMIT | Limits the number of rows returned by a query |
| ORDER BY | Sorts the result set by one or more columns in ascending or descending order |
| QUALIFY | Filters records based on window function conditions |
| SELECT | Retrieves data from one or more tables or views or within a function |
| UNION | Combines result sets of two or more SELECT statements, removing duplicates |
| WHERE | Filters records based on specified conditions |
| WITH | Introduces a Common Table Expression (CTE) for complex queries |
Data Type & Transformation
| Function/Keyword | Description |
|---|---|
| CAST | Converts a value from one data type to another |
| ELEMENT_AT | Returns the element at a specified position in an array. |
| GENERATOR | Creates rows of data based on a specified number of rows |
| GET | Returns a value from a semi-structured object or map. |
| GET_PATH | Extracts a value from JSON data using a path name |
| JSON_EXTRACT | Extracts a value from JSON data at the specified path. |
| JSON_EXTRACT_PATH_TEXT | Parses the first argument as a JSON string and returns the string value of the element pointed to by the path in the second argument |
| JSON_EXTRACT_SCALAR | Extracts a scalar string value from JSON data at the specified path. |
| JSON_PARSE | Parses a string as a JSON object |
| LATERAL FLATTEN | Unnests the ARRAY and JSON Object |
| OBJECT_CONSTRUCT | Create a Variant object from the list of key/value pairs in the arguments list |
| PARSEJSON | Parses a string as JSON |
| PIVOT | Rotates a table by turning the unique values from one column in the input expression into multiple columns and aggregating results on specified column values |
| TRY_CAST | Attempts to cast a value to a specified data type, returns NULL if unsuccessful |
Operators
| Function/Keyword | Description | Notes |
|---|---|---|
| [] | Used to access items in arrays, JSON strings, JSON objects, and variant data types | Array/JSON access |
| || | Used for string concatenation | Also a String function |
Date Functions
| Function/Keyword | Description |
|---|---|
| AT_TIMEZONE | Creates a timezone aware timestamp |
| CONVERTTIMEZONE | Converts a timestamp from one time zone to another |
| CURRENT_DATE | Returns the current date |
| CURRENT_TIME | Returns the current time |
| CURRENT_TIMESTAMP | Returns the current date and time. |
| DATE | Creates a date object from year, month, and day |
| DATEADD | Adds a specified number of time units to a date or timestamp |
| DATEDIFF | Returns the difference between two dates or timestamps |
| DATE_PART | Extracts a specified part of a date or timestamp. |
| DATE_TRUNC | Truncates a date or timestamp to the specified precision |
| DAY | Extracts the day from a date or timestamp |
| DAYOFWEEK | Returns the day of the week for a given date |
| DAYOFWEEK_ISO | Returns the ISO day of the week (1=Monday through 7=Sunday) for a date. |
| EXTRACT | Extracts a specified field (e.g., year, month) from a date or timestamp |
| FROM_ISO8601_TIMESTAMP | Parses the ISO 8601 formatted date and time string |
| GETDATE | Returns the current date and time |
| MONTH | Extracts the month from a date or timestamp |
| MONTHNAME | Returns the name of the month for a given date |
| QUARTER | Extracts the quarter (1-4) from a date |
| TIMESTAMP_TRUNC | Truncates a timestamp to the specified precision. |
| TIMESTAMP_TZ | Construct timezone aware timestamp from string or datetime object |
| TO_DATE | Converts a string to a date based on a specified format |
| TO_ISO8601 | Generate an ISO 8601 string from a value with type date, timestamp, or timestamp with time zone |
| TO_TIMESTAMP | Converts a string to a timestamp in UTC format. The string needs to be in the format yyyy-mm-dd hh:mm:ss |
| TRY_TO_DATE | Attempts to convert a string to a date, returns NULL if unsuccessful |
| YEAR | Extracts the year from a date or timestamp |
Array Functions
| Function/Keyword | Description | Notes |
|---|---|---|
| ARRAYS_OVERLAP | Returns TRUE if there is at least one element in common | |
| ARRAY_AGG | Returns the input values, pivoted into an array | |
| ARRAY_CAT | Returns an array by concatenating two arrays | |
| ARRAY_CONSTRUCT | Returns an array constructed from inputs | |
| ARRAY_CONTAINS | Returns TRUE if the specified value is found in the specified array | |
| ARRAY_INTERSECTION | Returns an array that contains the matching elements in the two input arrays | |
| ARRAY_JOIN | Concatenate the elements in an array using a separator to return one string | |
| ARRAY_SIZE | Returns the number of elements in an array | |
| ARRAY_TO_STRING | Concatenates array elements into a string using a separator. | |
| ARRAY_UNIQUE_AGG | Returns only the unique values aggregated as an array | |
| TO_ARRAY | Returns a single element array constructed from input |
String Functions
| Function/Keyword | Description | Notes |
|---|---|---|
| CHAR | Converts a numeric code to a character | |
| CONCAT | Concatenates two or more strings into a single string | |
| LENGTH | Returns the length of a string | Aliases: LEN |
| LOWER | Converts a string to lowercase | |
| REGEXP_COUNT | Returns the number of times a regular expression matches in a string | |
| REGEXP_REPLACE | Replaces substrings in a string based on a regular expression pattern | |
| REGEXP_SPLIT | Splits a string based on a regular expression pattern | Aliases: REGEX_SPLIT |
| REGEXP_SUBSTR | Returns a substring that matches a regular expression pattern | |
| REPLACE | Replaces occurrences of a substring within a string with another substring | |
| SPLIT | Splits a string into an array based on a specified delimiter | |
| SPLIT_PART | Returns a specific part of a string split by a delimiter | |
| STR_CONTAINS | Checks if a string contains a specified substring | |
| SUBSTR | Extracts a substring from a string starting at a specified position | |
| SUBSTRING | Returns a substring from a string | Aliases: SUBSTR |
| TO_VARCHAR | Converts a value to a VARCHAR data type | |
| TRIM | Removes leading and trailing spaces from a string | |
| UPPER | Converts a string to uppercase | |
| || | Used for string concatenation | Also in Query Syntax |
Numeric Functions
| Function/Keyword | Description |
|---|---|
| ABS | Returns the absolute (non-negative) value of a numeric expression or column |
| DIV0 | Performs division like the division operator (/), but returns 0 when the divisor is 0 (rather than reporting an error) |
| GREATEST | Returns the greatest value from a list of expressions |
| HASH | Returns a hash value for a given expression |
| LEAST | Returns the smallest value from a list of expressions |
| LN | Returns the natural logarithm of a numeric expression. |
| LOG | Returns the logarithm of a numeric expression. |
| POWER | Raises a number to the power of another number |
| RAND | Returns a random number between 0 and 1. |
| RANDOM | Returns a random number between 0 and 1 |
| ROUND | Rounds a numeric value to a specified number of decimal places. |
| TO_NUMERIC | Converts a value to a numeric data type |
| ZEROIFNULL | Returns zero if the value of the expression is NULL; Otherwise, returns the value of the input expression |
Aggregation Functions
| Function/Keyword | Description | Notes |
|---|---|---|
| ALL | Aggregate filter qualifier used with FILTER or WHERE in aggregate contexts. | |
| ARRAY_AGG | Returns the input values, pivoted into an array | |
| ARRAY_UNIQUE_AGG | Returns only the unique values aggregated as an array | |
| AVG | Returns the average value of a numeric column | |
| BOOLAND_AGG | Returns TRUE if all values in a group are true | |
| BOOLOR_AGG | Returns TRUE if any value in a group is true | |
| COUNT | Returns the number of rows matching a condition | |
| LISTAGG | Aggregates values from multiple rows into a single concatenated string | |
| MAX | Returns the maximum value from a set of values | |
| MEDIAN | Returns the value separating the higher half from the lower half of a set of values | |
| MIN | Returns the minimum value from a set of values | |
| PERCENTILECONT | Returns the percentile value for a numeric expression using PERCENTILECONT(value_expr, percentile) syntax. | |
| SOME | Aggregate filter qualifier used with FILTER or WHERE in aggregate contexts. | |
| STDDEV_POP | Calculates the standard deviation of a numeric column or expression by population | |
| STDDEV_SAMP | Calculates the standard deviation of a numeric column or expression | |
| SUM | Returns the total sum of a numeric column |
Rippling-Specific Functions
| Function/Keyword | Description |
|---|---|
| CURRENCY_AMOUNT | Extracts the numeric amount from an rp_currency value. |
| CURRENCY_TYPE | Extracts the currency code, such as USD, from an rp_currency value. |
| DATE_OF_CHANGE | Returns the date when a tracked field value changed (Rippling-specific). |
| DEPARTMENT_PATH | Returns the department hierarchy path for a role (Rippling-specific). |
| GET_TREE | Returns hierarchy tree values for org-structure filtering (Rippling-specific). |
| HIST_NEW_VALUE | Returns the new value from history tracking (Rippling-specific). |
| HIST_OLD_VALUE | Returns the previous value from history tracking (Rippling-specific). |
Window Functions and Syntax
Window Clause Syntax
function ( arguments ) OVER (
[ PARTITION BY expression [, ...] ]
[ ORDER BY expression [ ASC | DESC ] [, ...] ]
[ ROWS BETWEEN frame_start AND frame_end ]
)
| Function/Keyword | Description | Notes |
|---|---|---|
| OVER | Defines a window or user-specified set of rows within functions | Used with Window functions |
| PARTITION BY | Defines partitions within a function | Used with Window functions |
| ROWS | Specifies rows within a function |
Window Functions
| Function/Keyword | Description |
|---|---|
| DENSE_RANK | Assigns ranks to rows within a partition, with no gaps in ranking values |
| FIRST_VALUE | Returns the first value in an ordered set of values |
| LAG | Provides access to a row at a specified offset before the current row |
| LAST_VALUE | Returns the last value in an ordered set of values |
| LEAD | Provides access to a row at a specified offset after the current row |
| PERCENT_RANK | Returns the relative rank of a value within a partition (0 to 1). |
| RANK | Assigns a rank to each row within a partition of a result set |
| ROW_NUMBER | Assigns a unique sequential integer to rows within a partition |