New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Snowflake ARA-R01 Exam - 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:

0/2000 characters
Novella
3 months ago
Not sure about that, seems off to me.
upvoted 0 times
...
Florinda
3 months ago
Totally agree, STREAM_1 is 2 for sure!
upvoted 0 times
...
Katy
3 months ago
Wait, how does TRUNCATE affect the streams?
upvoted 0 times
...
Toshia
4 months ago
I think STREAM_2 will show 6.
upvoted 0 times
...
Francesco
4 months ago
STREAM_1 should have 2 records.
upvoted 0 times
...
Wilburn
4 months ago
I'm a bit confused about the delete operation. Does it affect the count in STREAM_2? I thought it would still be 3 for that one.
upvoted 0 times
...
Lashunda
4 months ago
I practiced a similar question, and I think the truncate affects STREAM_1 but not STREAM_2. So, could it be 2 and 6?
upvoted 0 times
...
Yoko
4 months ago
I remember that STREAM_2 is append-only, so it should keep all the inserts even after the truncate. That might mean it counts 6?
upvoted 0 times
...
Dorathy
5 months ago
I think STREAM_1 should count the inserts before the truncate, so maybe 2? But I'm not sure about STREAM_2.
upvoted 0 times
...
Vivan
5 months ago
This seems straightforward enough. The key is understanding how the APPEND_ONLY flag affects STREAM_2. I'm pretty confident I can work this out and select the right answer.
upvoted 0 times
...
Amber
5 months ago
I'm a bit confused by the APPEND_ONLY flag on STREAM_2. Does that mean it only captures new rows, and not updates or deletes? I'll need to double-check the documentation on that.
upvoted 0 times
...
Annice
5 months ago
Okay, let me think this through step-by-step. The first three INSERTs should be captured by both streams, then the TRUNCATE would clear both streams, and the final three INSERTs and DELETE would only be captured by STREAM_2. I think I've got it!
upvoted 0 times
...
Kimbery
5 months ago
Hmm, this looks like a tricky one. I'll need to carefully trace the sequence of operations on the table and streams to figure out the correct output.
upvoted 0 times
...
Amie
1 year 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
1 year ago
So, the correct answer would be B) 2 & 3.
upvoted 0 times
...
Harris
1 year ago
For the second SELECT COUNT (*) FROM STREAM_2, I believe the output would be 3.
upvoted 0 times
...
Nobuko
1 year ago
I think the output for the first SELECT COUNT (*) FROM STREAM_1 would be 2.
upvoted 0 times
...
...
Jerry
1 year 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
1 year ago
I'm not sure about the answer, but let's see if 'C' is correct.
upvoted 0 times
...
Kati
1 year ago
I believe the output for the second SELECT statement would be 3.
upvoted 0 times
...
Nathan
1 year ago
I think the output for the first SELECT statement would be 2.
upvoted 0 times
...
...
Timmy
1 year ago
Hmm, I see your point. Let's think about the operations and try to figure it out.
upvoted 0 times
...
Willis
1 year 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
1 year ago
Let's see if the streams capture the changes correctly.
upvoted 0 times
...
Mariko
1 year ago
I believe the output will be D) 4 & 6.
upvoted 0 times
...
Buck
1 year ago
I think the output would be A) 2 & 6.
upvoted 0 times
...
Miesha
1 year ago
Haha, that's a good one!
upvoted 0 times
...
...
Myrtie
1 year ago
I disagree, I believe it would be 4 & 3.
upvoted 0 times
...
Timmy
1 year ago
I think the output would be 2 & 6.
upvoted 0 times
...
Annabelle
1 year 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 year ago
No, I believe it would be 4 for STREAM_1 and 3 for STREAM_2.
upvoted 0 times
...
Meaghan
1 year ago
I think the output would be 2 for STREAM_1 and 6 for STREAM_2.
upvoted 0 times
...
...

Save Cancel