📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

STDDEV_POP



Aggregate function.

The STDDEV_POP() function returns the population standard deviation(the square root of VAR_POP()) of an expression.

Syntax

STDDEV_POP(<expr>) STDDEV(<expr>) STD(<expr>)

Arguments

ArgumentsDescription
<expr>Any numerical expression

Return Type

double

Example

Create a Table and Insert Sample Data

CREATE TABLE test_scores ( id INT, student_id INT, score FLOAT ); INSERT INTO test_scores (id, student_id, score) VALUES (1, 1, 80), (2, 2, 85), (3, 3, 90), (4, 4, 95), (5, 5, 100);

Query Demo: Calculate Population Standard Deviation of Test Scores

SELECT STDDEV_POP(score) AS test_score_stddev_pop FROM test_scores;

Result

| test_score_stddev_pop | |-----------------------| | 7.07107 |

Was this page helpful?