STDDEV_POP (Lakehouse v1)
Aggregate function.
The STDDEV_POP() function returns the population standard deviation(the square root of VAR_POP()) of an expression.
Analyze Syntax
Section titled “Analyze Syntax”func.stddev_pop(<expr>)Analyze Examples
Section titled “Analyze Examples”func.stddev_pop(table.score).alias('test_score_stddev_pop')
| test_score_stddev_pop ||-----------------------|| 7.07107 |SQL Syntax
Section titled “SQL Syntax”STDDEV_POP(<expr>)STDDEV(<expr>)STD(<expr>)Arguments
Section titled “Arguments”| Arguments | Description |
|---|---|
<expr> | Any numerical expression |
Return Type
Section titled “Return Type”double
SQL Examples
Section titled “SQL Examples”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_popFROM test_scores;Result
| test_score_stddev_pop ||-----------------------|| 7.07107 |