---
title: randn function
description: Learn the syntax of the randn function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/randn
---

# `randn` function

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime

Returns a random value from a standard normal distribution.

## Syntax

```
randn( [seed] )
```

## Arguments

* `seed`: An optional `INTEGER` literal.

## Returns

A `DOUBLE`.

The function regenerates pseudo random results with independent and identically distributed (i.i.d.) values drawn from the standard normal distribution.

This function is non-deterministic.

## Examples

```sql
> SELECT randn();
 -0.3254147983080288
> SELECT randn(0);
 1.1164209726833079
> SELECT randn(null);
 1.1164209726833079
```

## Related functions

* [`rand` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/rand.md)
* [`randstr` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/randstr.md)
* [`random` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/random.md)
* [`uniform` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/uniform.md)
