STDDEV()
Anonymous contributor
Published Sep 30, 2024
Contribute to Docs
The STDDEV()
is a built-in function for calculating the sample standard deviation for a set of values.
Syntax
STDDEV(column_name)
column_name
: column name for calculating the standard deviation.
Example
The following SQL snippet creates a students
table, inserts data, and uses the STDDEV()
function to calculate the sample standard deviation of marks
.
CREATE TABLE students (id INT PRIMARY KEY,name VARCHAR(50),marks DECIMAL(10, 2));INSERT INTO students (id, name, marks) VALUES(1, 'Alice', 96),(2, 'Bob', 80),(3, 'Charlie', 85),(4, 'David', 75),(5, 'Eve', 100);SELECT STDDEV(marks) AS "Sample standard deviation" FROM students;
The output would be:
Sample standard deviation |
---|
9.453041838477178 |
All contributors
- Anonymous contributor
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.