
Explanation:
Correct Answer: B — It will return a random 100 rows.
The TABLESAMPLE clause in Snowflake allows you to retrieve a random subset of rows from a table. When you use:
TABLESAMPLE (100 ROWS)
TABLESAMPLE (100 ROWS)
Snowflake interprets this as sampling by a fixed number of rows, not by percentage. It attempts to randomly return up to 100 rows from the gold_data table. If the table has fewer than 100 rows, it will return all available rows.
This is different from probability-based sampling, such as TABLESAMPLE (10), which selects rows based on a percentage chance.
0 ROWS were specified.Reference: https://docs.snowflake.com/en/sql-reference/constructs/sample
Ultimate access to all questions.
What will be the output of the following query executed on the table named gold_data?
SELECT * FROM gold_data TABLESAMPLE (100 ROWS);
SELECT * FROM gold_data TABLESAMPLE (100 ROWS);
A
It will return an empty sample.
B
It will return a random 100 rows.
C
It will return an entire table.
D
It will produce an error message.
