Sampling Methods - Teradata VantageCloud Lake

Lake - Working with SQL

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
jbe1714339405530.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
jbe1714339405530

Random Sampling

Vantage supports extracting a random sample from a database table using the SAMPLE clause and specifying one of the following:
  • The number rows
  • A fraction of the total number of rows
  • A set of fractions as the sample

This sampling method assumes that rows are sampled without replacement and are not reconsidered when another sample of the population is taken. This method returns mutually exclusive samples when you request multiple samples. In addition, the random sampling method assumes proportional allocation of rows across the AMPs in the system.

Random Stratified Sampling

Vantage supports stratified sampling.

Random Stratified Sampling, also called proportional or quota random sampling, involves dividing the population into homogeneous subgroups and taking a random sample in each subgroup. Stratified sampling represents both the overall population and key subgroups of the population. The fraction specification for stratified sampling refers to the fraction of the total number of rows in the stratum.

The following apply to stratified sampling.

Allowed Not Allowed
Stratified sampling in derived tables, views, and macros Stratified sampling with set operations or subqueries
Fraction or integer as sample size for every stratum Fraction and integer combinations
Up to 16 mutually exclusive samples for each stratum