> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

> Reference material for RANDOM function

# RANDOM

Returns a pseudo-random unsigned value greater than 0 and less than 1 of type `DOUBLE PRECISION`.

## Syntax

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
RANDOM()
```

## Return Types

`DOUBLE PRECISION`

## Examples

The following code example demonstrates using `RANDOM` without any other numeric functions. This generates a `DOUBLE PRECISION` value less than 1:

<div className="query-window">
  ```
  SELECT RANDOM()
  ```

  | random <span>double</span> |
  | :------------------------- |
  | 0.6527596650249162         |

  <p><span>Rows: 1</span><span>Execution time: 5.09ms</span></p>
</div>

To create a random integer number between two values, you can use `RANDOM` with the `FLOOR` function. If `a` is the lesser value and `b` is the greater value,
compute `FLOOR(RANDOM() * (b - a + 1)) + a`.
The following code example generates a random integer between 50 and 100:

<div className="query-window">
  ```
  SELECT FLOOR(RANDOM() * (100 - 50 + 1)) + 50
  ```

  | ?column? <span>double</span> |
  | :--------------------------- |
  | 67                           |

  <p><span>Rows: 1</span><span>Execution time: 5.51ms</span></p>
</div>
