In MySQL, the STDDEV_SAMP() function returns the sample standard deviation of a given expression. This is the square root of VAR_SAMP().
STDDEV_SAMP() is an aggregate function, and so it can be used with the GROUP BY clause.
If there are no matching rows, or if the expression is NULL, STDDEV_SAMP() returns NULL.