String Functions in Queries =========================== ArcaneDB provides a set of scalar string functions that can be applied to literal values within ``get`` and ``set`` statements. These functions transform their argument at query time. .. list-table:: :header-rows: 1 :widths: 25 75 * - Function - Description * - ``upper()`` - Converts a string literal to uppercase. * - ``title()`` - Converts a string literal to title case (first letter of each word capitalised). **Examples:** .. code-block:: aql -- Filter using title-cased comparison get * from TestBatch2 where name = title("eve"); -- Update a field to an uppercase value set TestBatch2 ( name: upper("billy") ) where name = "Bob"; Aggregate Functions =================== Aggregate functions are used within a ``get`` statement to compute summary statistics over a set of records. They operate over the values of a specified field, optionally constrained by a ``where`` clause. **Syntax:** .. code-block:: none get (), ... from [where ]; **Supported aggregate functions:** .. list-table:: :header-rows: 1 :widths: 25 75 * - Function - Description * - ``avg()`` - Arithmetic mean of non-null values. * - ``median()`` - Middle value when records are sorted; interpolated for even counts. * - ``min()`` - Smallest value. * - ``max()`` - Largest value. * - ``stddev()`` - Population standard deviation. * - ``sum()`` - Sum of all non-null values. * - ``count(*)`` - Total number of records in the result set. Multiple aggregate functions may be combined in a single ``get`` statement. **Examples:** .. code-block:: aql get avg(price), median(price), min(price), max(price), stddev(price) from Products where in_stock = true; get sum(price) from Products; get count(*) from Products;