• Skip to primary navigation
  • Skip to main content

Tech Honey

The #1 Website for Oracle PL/SQL, OA Framework and HTML

  • Home
  • HTML
    • Tags in HTML
    • HTML Attributes
  • OA Framework
    • Item in OAF
    • Regions in OAF
    • General OAF Topics
  • Oracle
    • statement
    • function
    • clause
    • plsql
    • sql
You are here: Home / Oracle / function / SQL STDDEV/Standard Deviation Function

SQL STDDEV/Standard Deviation Function

November 1, 2012 by techhoneyadmin

SQL STDDEV FunctionSQL Standard Deviation or SQL STDDEV Function returns the standard deviation of available records. Oracle Standard Deviation or Oracle STDDEV Function can accept a column name or formula as parameter for Standard Deviation calculation.


SQL Standard Deviation Function Syntax

SELECT STDDEV(numeric column / formula)
FROM table_name
WHERE conditions;

SQL Standard Deviation Function Examples

Suppose we have a table named “Employee” with the data as shown below.

Employee_Id Employee_Name Salary Department Commission
101 Emp A 10000 Sales 10
102 Emp B 20000 IT 20
103 Emp C 28000 IT 20
104 Emp D 30000 Support
105 Emp E 32000 Sales 10

Oracle STDDEV Function application is shown below.


SQL Standard Deviation – SQL STDDEV Simple Usage Example

SQL Standard Deviation query below will return the standard deviation of salaries of all employees.

SELECT STDDEV(salary) "SQL STDDEV"
FROM employee;

Above Oracle Standard Deviation query returns ‘9055.38513813742’ as standard deviation of all salaries in ‘employee’ table.

Note: We have aliased STDDEV(salary) as SQL STDDEV.


Oracle Standard Deviation – Oracle STDDEV Using Formula Example

SQL Standard Deviation query below calculates the Standard Deviation of Salary*Commission for ’employee’ table.

SELECT STDDEV(salary*(commission/100)) "Oracle STDDEV"
FROM employee;

Above Oracle Standard Deviation query returns ‘1913.98362932741’ as standard deviation of all salary*(commission/100) of ‘employee’ table.

Note: We have aliased STDDEV(salary*(commission/100)) as Oracle STDDEV.


Filed Under: function Tagged With: how to use stddev (standard deviation) function in oracle database query, how to use stddev (standard deviation) function in oracle plsql, how to use stddev (standard deviation) function in oracle sql, stddev (standard deviation) function in oracle plsql, stddev (standard deviation) function in oracle sql, STDDEVPLSQL, syntax and example of stddev (standard deviation) function in oracle database query, syntax and example of stddev (standard deviation) function in oracle plsql, syntax and example of stddev (standard deviation) function in oracle sql, using stddev (standard deviation) function in oracle database query, using stddev (standard deviation) function in oracle plsql, using stddev (standard deviation) function in oracle sql

Copyright © 2023 · Parallax Pro on Genesis Framework · WordPress · Log in