InputTable: titanic_train
Every complete example in this document is available in a zip file that you can download. The zip file includes a SQL script file that creates the input tables for the examples. If you are reading this document on https://docs.teradata.com/, you can download the zip file from the attachment in the left sidebar.
passenger survived name sex age fare --------- -------- ------ ------------------------------ ------ ---- -------- 97 0 Goldschmidt; Mr. George B male 71 34.6542 488 0 Kent; Mr. Edward Austin male 58 29.7 505 1 Maioni; Miss. Roberta female 16 86.5 631 1 Barkworth; Mr. Algernon Henry Wilson male 80 30 873 0 Carlsson; Mr. Frans Olof male 33 5
SQL Call
SELECT * FROM TD_UnivariateStatistics ( ON titanic_train USING TargetColumns ('age','fare') Stats ('MEAN', 'MEDIAN', 'MODE') ) AS dt;
Output
ATTRIBUTE StatName StatValue --------- -------- --------------------- age MEAN 5.16000000000000E 001 age MEDIAN 5.80000000000000E 001 age MODE 1.60000000000000E 001 fare MEAN 3.71708400000000E 001 fare MEDIAN 3.00000000000000E 001 fare MODE 5.00000000000000E 000