
Answer-first summary for fast verification
Answer: SELECT * FROM SNOWPRO TABLESAMPLE (10 ROWS), SELECT * FROM SNOWPRO SAMPLE BERNOULLI (10 ROWS)
The question requires selecting two methods to sample exactly 10 rows from the SNOWPRO table. Based on Snowflake documentation and community consensus with high upvotes, fixed-size row sampling (specifying 'ROWS') is only supported with BERNOULLI (or ROW) sampling method. Option B (TABLESAMPLE (10 ROWS)) uses the default BERNOULLI method and returns exactly 10 rows. Option E (SAMPLE BERNOULLI (10 ROWS)) explicitly uses BERNOULLI sampling and returns exactly 10 rows. Options A and C use SYSTEM/BLOCK sampling with percentage-based sampling (10%), which returns variable row counts, not fixed 10 rows. Option D explicitly tries BLOCK sampling with fixed rows, which Snowflake documentation confirms is unsupported and throws an error. The community discussion shows multiple users testing these options and confirming B and E consistently return 10 rows while others either return variable counts or fail.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
Which two methods can a Snowflake user employ to sample 10 rows from a table named SNOWPRO?
A
SELECT * FROM SNOWPRO SAMPLE SYSTEM (10)
B
SELECT * FROM SNOWPRO TABLESAMPLE (10 ROWS)
C
SELECT * FROM SNOWPRO TABLESAMPLE BLOCK (10)
D
SELECT * FROM SNOWPRO TABLESAMPLE BLOCK (10 ROWS)
E
SELECT * FROM SNOWPRO SAMPLE BERNOULLI (10 ROWS)
No comments yet.