BlackFriday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Snowflake Exam ARA-R01 Topic 4 Question 21 Discussion

Actual exam question for Snowflake's ARA-R01 exam
Question #: 21
Topic #: 4
[All ARA-R01 Questions]

A new table and streams are created with the following commands:

CREATE OR REPLACE TABLE LETTERS (ID INT, LETTER STRING) ;

CREATE OR REPLACE STREAM STREAM_1 ON TABLE LETTERS;

CREATE OR REPLACE STREAM STREAM_2 ON TABLE LETTERS APPEND_ONLY = TRUE;

The following operations are processed on the newly created table:

INSERT INTO LETTERS VALUES (1, 'A');

INSERT INTO LETTERS VALUES (2, 'B');

INSERT INTO LETTERS VALUES (3, 'C');

TRUNCATE TABLE LETTERS;

INSERT INTO LETTERS VALUES (4, 'D');

INSERT INTO LETTERS VALUES (5, 'E');

INSERT INTO LETTERS VALUES (6, 'F');

DELETE FROM LETTERS WHERE ID = 6;

What would be the output of the following SQL commands, in order?

SELECT COUNT (*) FROM STREAM_1;

SELECT COUNT (*) FROM STREAM_2;

Show Suggested Answer Hide Answer
Suggested Answer: C

In Snowflake, a stream records data manipulation language (DML) changes to its base table since the stream was created or last consumed. STREAM_1 will show all changes including the TRUNCATE operation, while STREAM_2, being APPEND_ONLY, will not show deletions like TRUNCATE. Therefore, STREAM_1 will count the three inserts, the TRUNCATE (counted as a single operation), and the subsequent two inserts before the delete, totaling 4. STREAM_2 will only count the three initial inserts and the two after the TRUNCATE, totaling 3, as it does not count the TRUNCATE or the delete operation.


Contribute your Thoughts:

Amie
1 months ago
Wait, wait, wait... Did they just casually mention 'APPEND_ONLY' like it's no big deal? That's the key to this whole question, I can feel it. Time to put on my thinking cap and work this out!
upvoted 0 times
Hillary
9 days ago
So, the correct answer would be B) 2 & 3.
upvoted 0 times
...
Harris
20 days ago
For the second SELECT COUNT (*) FROM STREAM_2, I believe the output would be 3.
upvoted 0 times
...
Nobuko
21 days ago
I think the output for the first SELECT COUNT (*) FROM STREAM_1 would be 2.
upvoted 0 times
...
...
Jerry
1 months ago
Oh boy, this one's got me stumped. I'll just go with my gut and hope for the best. Maybe I'll get lucky and the answer will be 'C' - that's always a safe bet, right?
upvoted 0 times
Anglea
7 days ago
I'm not sure about the answer, but let's see if 'C' is correct.
upvoted 0 times
...
Kati
21 days ago
I believe the output for the second SELECT statement would be 3.
upvoted 0 times
...
Nathan
24 days ago
I think the output for the first SELECT statement would be 2.
upvoted 0 times
...
...
Timmy
1 months ago
Hmm, I see your point. Let's think about the operations and try to figure it out.
upvoted 0 times
...
Willis
1 months ago
Hey, did you hear about the SQL developer who left his job? Apparently, he just couldn't handle all the table-turning situations anymore. Haha, get it? Table-turning? Oh, nevermind...
upvoted 0 times
Sommer
5 days ago
Let's see if the streams capture the changes correctly.
upvoted 0 times
...
Mariko
8 days ago
I believe the output will be D) 4 & 6.
upvoted 0 times
...
Buck
12 days ago
I think the output would be A) 2 & 6.
upvoted 0 times
...
Miesha
22 days ago
Haha, that's a good one!
upvoted 0 times
...
...
Myrtie
1 months ago
I disagree, I believe it would be 4 & 3.
upvoted 0 times
...
Timmy
2 months ago
I think the output would be 2 & 6.
upvoted 0 times
...
Annabelle
2 months ago
Hmm, looks like we're dealing with some data streaming here. I'm thinking the APPEND_ONLY stream should have more records than the regular stream, but let's see what the experts say.
upvoted 0 times
Ira
1 months ago
No, I believe it would be 4 for STREAM_1 and 3 for STREAM_2.
upvoted 0 times
...
Meaghan
1 months ago
I think the output would be 2 for STREAM_1 and 6 for STREAM_2.
upvoted 0 times
...
...

Save Cancel