ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 69 - ADA-C01 discussion

Report
Export

An Administrator needs to create a sample of the table LINEITEM. The sample should not be repeatable and the sampling function should take the data by blocks of rows.

What select command will generate a sample of 20% of the table?

A.
select * from LINEITEM sample bernoulli (20);
Answers
A.
select * from LINEITEM sample bernoulli (20);
B.
select * from LINEITEM sample system (20);
Answers
B.
select * from LINEITEM sample system (20);
C.
select * from LINEITEM tablesample block (20 rows);
Answers
C.
select * from LINEITEM tablesample block (20 rows);
D.
select * from LINEITEM tablesample system (20) seed (1);
Answers
D.
select * from LINEITEM tablesample system (20) seed (1);
Suggested answer: B

Explanation:

This command will generate a sample of 20% of the table by using the SYSTEM (or BLOCK) sampling method, which selects each block of rows with a probability of 20/100. This method is suitable for taking data by blocks of rows, as the question requires. According to theSnowflake documentation, ''SYSTEM (or BLOCK): Includes each block of rows with a probability of p/100. Similar to flipping a weighted coin for each block of rows. This method does not support fixed-size sampling.'' The other options are either incorrect or do not meet the requirements of the question. Option A uses the BERNOULLI (or ROW) sampling method, which selects each row with a probability of 20/100, but does not take data by blocks of rows. Option C uses the BLOCK sampling method, but specifies a fixed number of rows (20) instead of a percentage (20%). Option D uses the SYSTEM sampling method, but specifies a seed value (1), which makes the sampling repeatable, contrary to the question.

asked 23/09/2024
Tim Klein
37 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first