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-C01 Exam - Topic 5 Question 23 Discussion

Actual exam question for Snowflake's ARA-C01 exam
Question #: 23
Topic #: 5
[All ARA-C01 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
Ilene
3 months ago
STREAM_1 only tracks inserts, so 2 sounds correct!
upvoted 0 times
...
Scot
3 months ago
I think it's 4 for STREAM_1, not 2.
upvoted 0 times
...
Colton
3 months ago
Wait, how does STREAM_2 get 6 after a delete?
upvoted 0 times
...
Karol
4 months ago
Totally agree, STREAM_2 will count 6.
upvoted 0 times
...
Kanisha
4 months ago
STREAM_1 should count 2, right?
upvoted 0 times
...
Cecil
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 6.
upvoted 0 times
...
Martha
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
...
Ariel
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
...
Vernice
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
...
Dulce
5 months ago
I'm a bit confused by the APPEND_ONLY = TRUE on STREAM_2. Does that mean it keeps all the changes, even after the TRUNCATE? I'll need to double-check the behavior of that.
upvoted 0 times
...
Laquita
5 months ago
Okay, let me think this through step-by-step. The first three INSERTs should show up in both streams, then the TRUNCATE should clear both streams, and the final three INSERTs and one DELETE should only be in STREAM_2. I think I've got it!
upvoted 0 times
...
Ronny
5 months ago
Hmm, this looks like a tricky one. I'll need to carefully trace the operations on the table and streams to figure out the correct output.
upvoted 0 times
...
Margurite
5 months ago
This seems straightforward enough. The key is understanding how TRUNCATE and APPEND_ONLY work with the streams. I'm pretty confident I can work this out and get the right answer.
upvoted 0 times
...
Jestine
5 months ago
Hmm, this looks like a tricky one. I'll need to carefully read through the options and think about the Spring Data JDBC concepts we covered.
upvoted 0 times
...
Luisa
5 months ago
I'm a little confused by the wording of the question. It mentions "distribution" but also "reused and restocked", so I'm not sure if we're looking for something that tracks the part itself or the locations where it's stored. I'll have to re-read it a few times to make sure I understand the requirement.
upvoted 0 times
...
Venita
5 months ago
Ugh, I'm drawing a blank on the Burst In pattern. I know it has to do with managing IT resources, but I can't remember the details about the utilization trigger. I'll have to make an educated guess on this one.
upvoted 0 times
...
Vallie
5 months ago
I'm a bit confused by the different port types mentioned. I'll need to double-check my understanding of UCS fabric interconnect terminology before answering this.
upvoted 0 times
...
Laticia
2 years ago
I think the answer is option C) 4 & 3.
upvoted 0 times
...
Cherilyn
2 years ago
I'm not sure about the first query, but I think the second query should return 6.
upvoted 0 times
...
Eric
2 years ago
I believe the output of the second query is 3.
upvoted 0 times
...
Lashaun
2 years ago
I think the output of the first query is 2.
upvoted 0 times
Mira
2 years ago
C
upvoted 0 times
...
Mira
2 years ago
What happened to stream 2?
upvoted 0 times
...
Mira
2 years ago
A
upvoted 0 times
...
...
Ezekiel
2 years ago
Wait, hold up. Are we sure the TRUNCATE operation doesn't affect the APPEND_ONLY stream? I've heard some weird things about how that works, and I'm not entirely convinced the answer is that straightforward.
upvoted 0 times
...
Deeanna
2 years ago
I don't know, man. This streaming stuff is confusing. I'm just going to guess C and hope for the best. Maybe I should have studied more instead of binge-watching that new show on Netflix last night.
upvoted 0 times
...
Elli
2 years ago
You guys are overthinking this. The question is pretty straightforward – the TRUNCATE clears the table, so the first stream should only have the last 2 inserts, and the second stream should have all 6 inserts. The answer is D, 4 and 6.
upvoted 0 times
...
Stephaine
2 years ago
Hold on, I'm not so sure about that. Doesn't the TRUNCATE operation also affect the streams? I'm thinking the counts should be 4 and 3, since the first stream would have all the records, and the second stream would only have the last 3 inserts.
upvoted 0 times
...
Cory
2 years ago
Hmm, I think I've got an idea. The TRUNCATE operation should clear the table, but the APPEND_ONLY stream should still have all the previous records, right? So the counts should be 2 and 6 for the two streams.
upvoted 0 times
...
Luisa
2 years ago
Whoa, this question is tricky! I'm not sure I fully understand how the APPEND_ONLY flag works for the streams. Does that mean the second stream will only ever grow and never shrink, even after a TRUNCATE operation? This is going to be a tough one to figure out.
upvoted 0 times
...

Save Cancel