For AI agents: an index of this documentation is at https://developer.rippling.com/llms.txt. Public pages have a Markdown version at the same URL with .md added.

Skip to main content
index

SQL Reference Glossary

Use with AI:Rippling AI ChatGPT Claude Cursor

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.

TypeDescription
VARCHARVariable-length character string
TEXTText data (treated as string)
INT/INTEGERInteger (whole numbers)
FLOATFloating-point number (64-bit inexact)
DECIMALPrecise decimal number (up to 38 digits)
BOOLEANTrue/false value
DATECalendar date (YYYY-MM-DD)
TIMESTAMPDate and time (YYYY-MM-DD HH:MM:SS)
ARRAYOrdered collection of values
JSONSemi-structured JSON data
VARIANTFlexible type for heterogeneous data
NULLRepresents missing or unknown values

Joins​

Function/KeywordDescription
CROSS JOINReturns the Cartesian product of two tables
INNER JOINReturns records with matching values in both tables
JOINCombines rows from two or more tables based on a related column
LEFT JOINReturns all records from the left table and matched records from the right
ONSpecifies the condition for a join operation or a function
USINGSpecifies columns for equijoins

Conditionals & Logic​

Function/KeywordDescription
ANDCombines multiple conditions, returning TRUE if all are true
ANYChecks if any element in a set satisfies a condition
BETWEENFilters results within a range of values
CASEImplements conditional logic, returning different results based on conditions
COALESCEReturns the first non-null value in a list of arguments
DECODECompares an expression to search values and returns the matching result. DECODE(...) is accepted in Rippling SQL; the parser normalizes it to CASE during conversion.
EXISTSTests whether a subquery returns any rows.
IFFA conditional function that returns one of two values based on a boolean expression
IFNULLReturns the first non-null value: expression when it is not NULL, otherwise fallback. Accepted COALESCE-style alias (parser normalizes to COALESCE).
ILIKECase-insensitive version of LIKE
INChecks if a value exists within a list of values or subquery
IS NULLChecks for NULL values
LIKESearches for a specified pattern in a column
NOTNegates a condition
NULLIFReturns NULL if expression1 is equal to expression2, otherwise returns expression1
NVLReturns the first non-null value: expression when it is not NULL, otherwise fallback. Accepted COALESCE-style alias (parser normalizes to COALESCE).
ORCombines multiple conditions, returning TRUE if at least one is true

Clauses & Keywords​

Function/KeywordDescription
ASAssigns an alias to a column or table
DESCSpecifies descending order for sorting
DISTINCTEliminates duplicate rows from the result set or used with aggregate functions to return unique values
EXCEPTReturns the rows that are in the result set of the first query, but not the second
FROMSpecifies the table or view from which to retrieve data or the source of data within a function
GROUP BYGroups rows sharing a property for aggregate functions
LIMITLimits the number of rows returned by a query
ORDER BYSorts the result set by one or more columns in ascending or descending order
QUALIFYFilters records based on window function conditions
SELECTRetrieves data from one or more tables or views or within a function
UNIONCombines result sets of two or more SELECT statements, removing duplicates
WHEREFilters records based on specified conditions
WITHIntroduces a Common Table Expression (CTE) for complex queries

Data Type & Transformation​

Function/KeywordDescription
CASTConverts a value from one data type to another
ELEMENT_ATReturns the element at a specified position in an array.
GENERATORCreates rows of data based on a specified number of rows
GETReturns a value from a semi-structured object or map.
GET_PATHExtracts a value from JSON data using a path name
JSON_EXTRACTExtracts a value from JSON data at the specified path.
JSON_EXTRACT_PATH_TEXTParses 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_SCALARExtracts a scalar string value from JSON data at the specified path.
JSON_PARSEParses a string as a JSON object
LATERAL FLATTENUnnests the ARRAY and JSON Object
OBJECT_CONSTRUCTCreate a Variant object from the list of key/value pairs in the arguments list
PARSEJSONParses a string as JSON
PIVOTRotates 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_CASTAttempts to cast a value to a specified data type, returns NULL if unsuccessful

Operators​

Function/KeywordDescriptionNotes
[]Used to access items in arrays, JSON strings, JSON objects, and variant data typesArray/JSON access
||Used for string concatenationAlso a String function

Date Functions​

Function/KeywordDescription
AT_TIMEZONECreates a timezone aware timestamp
CONVERTTIMEZONEConverts a timestamp from one time zone to another
CURRENT_DATEReturns the current date
CURRENT_TIMEReturns the current time
CURRENT_TIMESTAMPReturns the current date and time.
DATECreates a date object from year, month, and day
DATEADDAdds a specified number of time units to a date or timestamp
DATEDIFFReturns the difference between two dates or timestamps
DATE_PARTExtracts a specified part of a date or timestamp.
DATE_TRUNCTruncates a date or timestamp to the specified precision
DAYExtracts the day from a date or timestamp
DAYOFWEEKReturns the day of the week for a given date
DAYOFWEEK_ISOReturns the ISO day of the week (1=Monday through 7=Sunday) for a date.
EXTRACTExtracts a specified field (e.g., year, month) from a date or timestamp
FROM_ISO8601_TIMESTAMPParses the ISO 8601 formatted date and time string
GETDATEReturns the current date and time
MONTHExtracts the month from a date or timestamp
MONTHNAMEReturns the name of the month for a given date
QUARTERExtracts the quarter (1-4) from a date
TIMESTAMP_TRUNCTruncates a timestamp to the specified precision.
TIMESTAMP_TZConstruct timezone aware timestamp from string or datetime object
TO_DATEConverts a string to a date based on a specified format
TO_ISO8601Generate an ISO 8601 string from a value with type date, timestamp, or timestamp with time zone
TO_TIMESTAMPConverts a string to a timestamp in UTC format. The string needs to be in the format yyyy-mm-dd hh:mm:ss
TRY_TO_DATEAttempts to convert a string to a date, returns NULL if unsuccessful
YEARExtracts the year from a date or timestamp

Array Functions​

Function/KeywordDescriptionNotes
ARRAYS_OVERLAPReturns TRUE if there is at least one element in common
ARRAY_AGGReturns the input values, pivoted into an array
ARRAY_CATReturns an array by concatenating two arrays
ARRAY_CONSTRUCTReturns an array constructed from inputs
ARRAY_CONTAINSReturns TRUE if the specified value is found in the specified array
ARRAY_INTERSECTIONReturns an array that contains the matching elements in the two input arrays
ARRAY_JOINConcatenate the elements in an array using a separator to return one string
ARRAY_SIZEReturns the number of elements in an array
ARRAY_TO_STRINGConcatenates array elements into a string using a separator.
ARRAY_UNIQUE_AGGReturns only the unique values aggregated as an array
TO_ARRAYReturns a single element array constructed from input

String Functions​

Function/KeywordDescriptionNotes
CHARConverts a numeric code to a character
CONCATConcatenates two or more strings into a single string
LENGTHReturns the length of a stringAliases: LEN
LOWERConverts a string to lowercase
REGEXP_COUNTReturns the number of times a regular expression matches in a string
REGEXP_REPLACEReplaces substrings in a string based on a regular expression pattern
REGEXP_SPLITSplits a string based on a regular expression patternAliases: REGEX_SPLIT
REGEXP_SUBSTRReturns a substring that matches a regular expression pattern
REPLACEReplaces occurrences of a substring within a string with another substring
SPLITSplits a string into an array based on a specified delimiter
SPLIT_PARTReturns a specific part of a string split by a delimiter
STR_CONTAINSChecks if a string contains a specified substring
SUBSTRExtracts a substring from a string starting at a specified position
SUBSTRINGReturns a substring from a stringAliases: SUBSTR
TO_VARCHARConverts a value to a VARCHAR data type
TRIMRemoves leading and trailing spaces from a string
UPPERConverts a string to uppercase
||Used for string concatenationAlso in Query Syntax

Numeric Functions​

Function/KeywordDescription
ABSReturns the absolute (non-negative) value of a numeric expression or column
DIV0Performs division like the division operator (/), but returns 0 when the divisor is 0 (rather than reporting an error)
GREATESTReturns the greatest value from a list of expressions
HASHReturns a hash value for a given expression
LEASTReturns the smallest value from a list of expressions
LNReturns the natural logarithm of a numeric expression.
LOGReturns the logarithm of a numeric expression.
POWERRaises a number to the power of another number
RANDReturns a random number between 0 and 1.
RANDOMReturns a random number between 0 and 1
ROUNDRounds a numeric value to a specified number of decimal places.
TO_NUMERICConverts a value to a numeric data type
ZEROIFNULLReturns zero if the value of the expression is NULL; Otherwise, returns the value of the input expression

Aggregation Functions​

Function/KeywordDescriptionNotes
ALLAggregate filter qualifier used with FILTER or WHERE in aggregate contexts.
ARRAY_AGGReturns the input values, pivoted into an array
ARRAY_UNIQUE_AGGReturns only the unique values aggregated as an array
AVGReturns the average value of a numeric column
BOOLAND_AGGReturns TRUE if all values in a group are true
BOOLOR_AGGReturns TRUE if any value in a group is true
COUNTReturns the number of rows matching a condition
LISTAGGAggregates values from multiple rows into a single concatenated string
MAXReturns the maximum value from a set of values
MEDIANReturns the value separating the higher half from the lower half of a set of values
MINReturns the minimum value from a set of values
PERCENTILECONTReturns the percentile value for a numeric expression using PERCENTILECONT(value_expr, percentile) syntax.
SOMEAggregate filter qualifier used with FILTER or WHERE in aggregate contexts.
STDDEV_POPCalculates the standard deviation of a numeric column or expression by population
STDDEV_SAMPCalculates the standard deviation of a numeric column or expression
SUMReturns the total sum of a numeric column

Rippling-Specific Functions​

Function/KeywordDescription
CURRENCY_AMOUNTExtracts the numeric amount from an rp_currency value.
CURRENCY_TYPEExtracts the currency code, such as USD, from an rp_currency value.
DATE_OF_CHANGEReturns the date when a tracked field value changed (Rippling-specific).
DEPARTMENT_PATHReturns the department hierarchy path for a role (Rippling-specific).
GET_TREEReturns hierarchy tree values for org-structure filtering (Rippling-specific).
HIST_NEW_VALUEReturns the new value from history tracking (Rippling-specific).
HIST_OLD_VALUEReturns 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/KeywordDescriptionNotes
OVERDefines a window or user-specified set of rows within functionsUsed with Window functions
PARTITION BYDefines partitions within a functionUsed with Window functions
ROWSSpecifies rows within a function

Window Functions​

Function/KeywordDescription
DENSE_RANKAssigns ranks to rows within a partition, with no gaps in ranking values
FIRST_VALUEReturns the first value in an ordered set of values
LAGProvides access to a row at a specified offset before the current row
LAST_VALUEReturns the last value in an ordered set of values
LEADProvides access to a row at a specified offset after the current row
PERCENT_RANKReturns the relative rank of a value within a partition (0 to 1).
RANKAssigns a rank to each row within a partition of a result set
ROW_NUMBERAssigns a unique sequential integer to rows within a partition