Deal of The Day! 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
3 days 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
...
Jerry
9 days 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
...
Timmy
14 days ago
Hmm, I see your point. Let's think about the operations and try to figure it out.
upvoted 0 times
...
Willis
14 days 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
...
Myrtie
16 days ago
I disagree, I believe it would be 4 & 3.
upvoted 0 times
...
Timmy
23 days ago
I think the output would be 2 & 6.
upvoted 0 times
...
Annabelle
1 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
14 days ago
No, I believe it would be 4 for STREAM_1 and 3 for STREAM_2.
upvoted 0 times
...
Meaghan
15 days ago
I think the output would be 2 for STREAM_1 and 6 for STREAM_2.
upvoted 0 times
...
...

Save Cancel