Exam DSA-C03 Topic 1 Question 209 Discussion
Actual exam question for Snowflake's DSA-C03 exam
Question #: 209
Topic #: 1
Question #: 209
Topic #: 1
A retail company is using Snowflake to store transaction data'. They want to create a derived feature called 'customer _ recency' to represent the number of days since a customer's last purchase. The transactions table 'TRANSACTIONS has columns 'customer_id' (INT) and 'transaction_date' (DATE). Which of the following SQL queries is the MOST efficient and scalable way to derive this feature as a materialized view in Snowflake?


Suggested Answer: C Vote an answer
Option C is the most efficient because it correctly calculates the number of days since the last transaction using and 'DATEDIFF. The 'OR REPLACE clause ensures that the materialized view can be updated if it already exists. Options A and B are syntactically identical but A is slightly more correct since it considers the MAX. Option D calculates recency from the first transaction, which is incorrect. Option E is similar to option C but less performant since we want datediff on max(transaction_date) and not calculate and take the max over it.
by Kennedy at Sep 17, 2025, 05:21 PM
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).