SnowPro Core Certification — Question 1226
When working with table MY_TABLE that contains 10 rows, which sampling query will always return exactly 5 rows?
Answer options
- A. SELECT * FROM MY_TABLE SAMPLE SYSTEM (5);
- B. SELECT * FROM MY_TABLE SAMPLE BERNOULLI (5);
- C. SELECT * FROM MY_TABLE SAMPLE (5 ROWS);
- D. SELECT * FROM MY_TABLE SAMPLE SYSTEM (1) SEED (5);
Correct answer: C
Explanation
The correct option, C, uses the SAMPLE clause with a specific number of rows, ensuring it returns exactly 5 rows from MY_TABLE. Options A and D use the SYSTEM sampling method, which does not guarantee a fixed number of rows, while option B uses BERNOULLI sampling, which is probabilistic and may not return 5 rows consistently.