Mysql Variance

Hi guys,

THis is an example from
http://www.java2s.com/Code/PostgreSQL/Analytical-Functions/Variancefunctiondemo.htm

could someone explain to me, help me understand, what is being calculated when i use Variance?

Thanks

id |  name  | salary | start_date |   city    | region
----+--------+--------+------------+-----------+--------
1 | Jason  |  40420 | 1994-02-01 | New York  | W
2 | Robert |  14420 | 1995-01-02 | Vancouver | N
3 | Celia  |  24020 | 1996-12-03 | Toronto   | W
4 | Linda  |  40620 | 1997-11-04 | New York  | N
5 | David  |  80026 | 1998-10-05 | Vancouver | W
6 | James  |  70060 | 1999-09-06 | Toronto   | N
7 | Alison |  90620 | 2000-08-07 | New York  | W
8 | Chris  |  26020 | 2001-07-08 | Vancouver | N
9 | Mary   |  60020 | 2002-06-09 | Toronto   | W
(9 rows)

postgres=#
postgres=# SELECT variance(salary) FROM employee;
variance
-----------
718558064
LVL 8
Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Variance is a statistical function which based on given set of numbers give you a number which tells you "how much are these values usually far from its average". If the variance is close to 0 the values within the set are close to each other and vice versa. Better explanation is given e.g. at http://en.wikipedia.org/wiki/Variance

PS (for a statistician who reads this): The explanation is given using very vague terms for better understandability.
0

Experts Exchange Solution brought to you by