lly-distributed pseudo-random floating point number with
specified ` _ mean  _ ` and ` _ stddev  _ ` (standard deviation).

##  Syntax  ¶

    
    
    NORMAL( <mean> , <stddev> , <gen> )
    

Copy

##  Arguments  ¶

` _ mean  _ `

    

A constant specifying the value that the output values should be centered on.

` _ stddev  _ `

    

A constant specifying the width of one standard deviation.

For example, if you specify a mean of 0.0 and a standard deviation of 1.0,
approximately 68.2% of returned values from multiple calls will be between
-1.0 and +1.0 (i.e. within one standard deviation of the mean).

Similarly, if you choose a mean of 5.0 and a standard deviation of 2, then
approximately 68.2% of values will be between 3.0 and 7.0.

` _ gen  _ `

    

An expression that serves as a raw source of uniform random numbers, typically
the ` RANDOM  ` function. For more information, see the Data Generation
Functions [ Usage Notes  ](../functions-data-generation.html#label-rand-dist-
functions) .

##  Returns  ¶

Returns a random floating-point number. The accumulated results of a large
number of repeated calls approximate a normal distribution.

##  Usage Notes  ¶

This function is related to, but different from, the [ RANDOM  ](random)
function, both in the ranges of the values returned and their distribution.

  * ` RANDOM  ` generates random 64-bit integers in a uniform distribution. It accepts an optional seed that allows random sequences to be repeated. 

When ` RANDOM  ` is called a large number of times, the results are more or
less evenly distributed over the range of possible values. For example, the
number of results with values between 1000 and 2000 is similar to the number
of values between 2000 and 3000.

  * ` NORMAL  ` generates random integer or floating-point numbers centered on the specified mean, with the specified standard deviation. 

When ` NORMAL  ` is called a large number of times, the distribution of the
results is likely to approximate a “normal” curve (a “bell-shaped curve”). The
center of the curve and its “breadth” are influenced by the ` _ mean  _ ` and
` _ stddev  _ ` parameters. Values closer to the specified mean are more
likely to occur than values far from the mean.

##  Examples  ¶

This shows typical usage with a mean of 0 and a standard deviation of 1:

>
>     SELECT normal(0, 1, random()) FROM table(generator(rowCount => 5));
>  
>     +------------------------+
>     | NORMAL(0, 1, RANDOM()) |
>     |------------------------|
>     |           0.227384164  |
>     |           0.9945290748 |
>     |          -0.2045078571 |
>     |          -1.594607893  |
>     |          -0.8213296842 |
>     +------------------------+
>  
>
> Copy

This shows that if the ` _ gen  _ ` parameter is a constant, then the output
is a constant:

>
>     SELECT normal(0, 1, 1234) FROM table(generator(rowCount => 5));
>  
>     +--------------------+
>     | NORMAL(0, 1, 1234) |
>     |--------------------|
>     |      -0.6604156716 |
>     |      -0.6604156716 |
>     |      -0.6604156716 |
>     |      -0.6604156716 |
>     |      -0.6604156716 |
>     +--------------------+
>  
>
> Copy

Was this page helpful?

Yes  No

[ Visit Snowflake ](https://www.snowflake.com)

[ Join the conversation ](https://community.snowflake.com/s/)

[ Develop with Snowflake ](https://developers.snowflake.com)

[ Share your feedback ](/feedback)

[ Read the latest on our blog ](https://www.snowflake.com/blog/)

[ Get your own certification ](https://learn.snowflake.com)

[ Privacy Notice ](https://www.snowflake.com/privacy-policy/) [ Site Terms
](https://www.snowflake.com/legal/snowflake-site-terms/) ©  2024  Snowflake,
Inc.  All Rights Reserved  .

On this page

  1. Syntax 
  2. Arguments 
  3. Returns 
  4. Usage Notes 
  5. Examples 

Language  :  **English**

  * [ English ](/en/sql-reference/functions/normal)
  * [ Français ](/fr/sql-reference/functions/normal)
  * [ Deutsch ](/de/sql-reference/functions/normal)
  *