Operators in [Druid SQL](./sql.md) typically operate on one or two values and return a result based on the values. Types of operators in Druid SQL include arithmetic, comparison, logical, and more, as described here.
When performing math operations, Druid uses 64-bit integer (long) data type unless there are double or float values. If an operation uses float or double values, then the result is a double, which is a 64-bit float. The precision of float and double values is defined by [Java](https://docs.oracle.com/javase/specs/jls/se8/html/jls-5.html) and [the IEEE standard](https://en.wikipedia.org/wiki/IEEE_754).
Keep the following guidelines in mind to help you manage precision issues:
- Long values can store up to 2^63 accurately with an additional bit used for the sign.
- Float values use 32 bits, and doubles use 64 bits. Both types are impacted by floating point precision. If you need exact decimal values, consider storing the number in a non-decimal format as a long value (up to the limit for longs). For example, if you need three decimal places, store the number multiplied by 1000 and then divide by 1000 when querying.
|`x IS NOT NULL`|True if _x_ is neither NULL nor empty string|
|`x IS TRUE`|True if _x_ is true|
|`x IS NOT TRUE`|True if _x_ is not true|
|`x IS FALSE`|True if _x_ is false|
|`x IS NOT FALSE`|True if _x_ is not false|
|`x BETWEEN y AND z`|Equivalent to `x >= y AND x <= z`|
|`x NOT BETWEEN y AND z`|Equivalent to `x < y OR x > z`|
|`x LIKE pattern [ESCAPE esc]`|True if _x_ matches a SQL LIKE pattern (with an optional escape)|
|`x NOT LIKE pattern [ESCAPE esc]`|True if _x_ does not match a SQL LIKE pattern (with an optional escape)|
|`x IN (values)`|True if _x_ is one of the listed values|
|`x NOT IN (values)`|True if _x_ is not one of the listed values|
|`x IN (subquery)`|True if _x_ is returned by the subquery. This will be translated into a join; see [Query translation](sql-translation.md) for details.|
|`x NOT IN (subquery)`|True if _x_ is not returned by the subquery. This will be translated into a join; see [Query translation](sql-translation.md) for details.|
|`PIVOT (aggregation_function(column_to_aggregate) FOR column_with_values_to_pivot IN (pivoted_column1 [, pivoted_column2 ...]))`|Carries out an aggregation and transforms rows into columns in the output.|
|`UNPIVOT (values_column FOR names_column IN (unpivoted_column1 [, unpivoted_column2 ... ]))`|Transforms existing column values into rows.|