Oracle SQL - STDDEV_POP function

Introduction

STDDEV_POP function computes the population standard deviation and gives the square root of the population variance.

The general format for this function is:

STDDEV_POP(expr) [OVER(analytic_clause)] 

Demo

SQL>
SQL>-- from   www .  j ava2  s .co m
SQL> SELECT STDDEV_POP(y) FROM my_table;

STDDEV_POP(Y)
-------------
     00267.33

SQL>

Given the following table.

Demo

SQL>
SQL> drop table my_table;

Table dropped.-- from w  ww .ja  v  a2s.  com

SQL> create table my_table(
  2  x      NUMBER(4)  primary key,
  3  y      NUMBER(4)  not null);
SQL>
SQL> insert into my_table values(1,2);
SQL> insert into my_table values(2,4);
SQL> insert into my_table values(3,6);
SQL> insert into my_table values(4,9);
SQL> insert into my_table values(5,13);
SQL> insert into my_table values(6,16);
SQL> insert into my_table values(7,20);
SQL> insert into my_table values(8,27);
SQL> insert into my_table values(9,32);
SQL> insert into my_table values(10,47);
SQL> insert into my_table values(11,53);
SQL> insert into my_table values(12,60);
SQL> insert into my_table values(13,76);
SQL> insert into my_table values(14,100);
SQL> insert into my_table values(15,130);
SQL> insert into my_table values(16,189);
SQL> insert into my_table values(17,300);
SQL> insert into my_table values(18,789);
SQL> insert into my_table values(19,1000);
SQL>