> ## 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 VAR_POP

# VAR_POP

Computes the population variance of all non-`NULL` numeric values produced by an expression. The population variance measures the average of the squared differences from the population mean, indicating how spread out the values are within the entire population. For information about the sample variance, which measures how spread out the values are within a sample, see [VAR\_SAMP](/reference-sql/functions-reference/aggregation/variance-samp).

## Syntax

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
VAR_POP(<expression>) [FILTER ([WHERE] <condition>)]
```

## Parameters

| Parameter      | Description                                                                            | Supported input types      |
| :------------- | :------------------------------------------------------------------------------------- | :------------------------- |
| `<expression>` | An expression producing numeric values for which to calculate the population variance. | `REAL`, `DOUBLE PRECISION` |
| `<condition>`  | An optional boolean expression to filter rows used in aggregation                      | `BOOL`                     |

## Return Type

`VAR_POP` returns a result of type `DOUBLE PRECISION`.

### Special cases

* If there are no non-`NULL` input values, the result is `NULL`.
* If the input contains an `Inf` or `NaN` value, the result will be `NaN`.

## Example

The following example calculates the population variance of five grade values:

<div className="query-window">
  ```
  SELECT ROUND(VAR_POP(grade::double precision), 3) AS variance
  FROM UNNEST(ARRAY[4.0, 3.7, 3.3, 2.7, 2.7]) AS t(grade);
  ```

  | variance <span>double null</span> |
  | :-------------------------------- |
  | 0.274                             |

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