COVAR_SAMP is one of the vital Analytic functions of Oracle. It is used to get the sample covariance of a set of number pairs. The COVAR_SAMP function is supported in the various versions of the Oracle/PLSQL, including, Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i and Oracle 8i.
COVAR_SAMP ( expr1, expr2 )
expr1, expr2: They are used to specify the numerical expressions to be used for calculation.
select COVAR_SAMP (avg_age, avg_marks) from students;
Here, the sample covariance will be returned for the fields called ‘avg_age’ and ‘avg_marks’ of the ‘students’ table.