SnowPro Core Certification — Question 1293
The ORDERS table contains 12,000 rows.
Which query will return 10 rows that are randomly sampled from the table every time the query is run?
Answer options
- A. select * from ORDERS fetch 10;
- B. select * from ORDERS limit 10;
- C. select * from ORDERS sample (10);
- D. select * from ORDERS tablesample (10 rows);
Correct answer: D
Explanation
The correct answer is D, as the 'tablesample' clause allows for random sampling of rows from a table. Options A and B simply limit the number of rows returned, but do not ensure randomness. Option C is incorrect because the 'sample' syntax is not standard SQL and may not function as intended.