Exam SPS-C01 Topic 1 Question 32 Discussion
Actual exam question for Snowflake's SPS-C01 exam
Question #: 32
Topic #: 1
Question #: 32
Topic #: 1
You have a Snowpark DataFrame 'products_df with columns 'product_id', 'category', and 'price'. You want to find the top 3 most expensive products within each category Which of the following Snowpark code snippets will accomplish this, using window functions?
Suggested Answer: D Vote an answer
Option D correctly partitions the data by category, orders by price in descending order (most expensive first), assigns a rank using , and then filters for ranks less than or equal to 3. Option A misses the snowflake.snowpark.functions import, but functionally same as D. Option B orders by price in ascending order (cheapest first). Option C does not partition by category and Option E filters where rank < 3 instead of less than or equal to. D is most correct because of syntax and concept implementation, and will pass the code check
by Quincy at May 16, 2026, 09:24 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).