Exam DSA-C03 Topic 1 Question 51 Discussion
Actual exam question for Snowflake's DSA-C03 exam
Question #: 51
Topic #: 1
Question #: 51
Topic #: 1
You are analyzing sales data in Snowflake using Snowpark to identify seasonality. You have a table named 'SALES DATA with columns 'SALE DATE (TIMESTAMP NTZ) and 'AMOUNT (NUMBER). You want to calculate the rolling average sales for each week over a period of 12 weeks using a Snowpark DataFrame. Which of the following Snowpark code snippets correctly implements this calculation?
Suggested Answer: B,E Vote an answer
Options B and E are correct. They both calculate the 12 week rolling average grouped by week correctly and will display the average. Option B is the more correct of the two, because it does not require the user to sort the result to get the appropriate rolling average. Option A is incorrect because rangeBetween with seconds is not appropriate for weekly aggregation and calculation. Option C is incorrect because to_date would truncate the time component, grouping everything with the same date. Option D calculates a cumulative average since the beginning of the dataset
by Lennon at Jun 09, 2025, 03:51 AM
0
0
0
10
Comments
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Commenting
You can sign-up / login (it's free).