16.20 - Example: Using the SELECT statement to Return the Sample Covariance of Weight and Height - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2020-03-25
dita:mapPath
xzf1512079057909.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval
dita:id
kby1472250656485

This example is based on the following regrtbl data. Nulls are indicated by the QUESTION MARK character.

c1 height weight
1 60 84
2 62 95
3 64 140
4 66 155
5 68 119
6 70 175
7 72 145
8 74 197
9 76 150
10 76 ?
11 ? 150
12 ? ?

The following SELECT statement returns the sample covariance of weight and height where neither weight nor height is null.

   SELECT COVAR_SAMP(weight,height) 
   FROM regrtbl;

   Covar_Samp(weight,height)
   -------------------------
                         150