BLACK FRIDAY SALE – Unlock Up to 25% OFF on All Exam Prep! - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Databricks Certified Data Analyst Associate Exam - Topic 2 Question 59 Discussion

Posted by Thaddeus on Oct 17, 2026 at 11:57 PM

A data analyst has been asked to use the below table sales_table to rank products within region by the sales.

Input table:

region product sales

WEST A 1880.59

EAST A 2045.99

EAST B 4583.23

WEST B 3391.19

The result of the query should look like this:

region product rank

EAST B 1

EAST A 2

WEST B 1

WEST A 2

Which query will accomplish this task?

A.

SELECT

region,

product,

RANK() OVER (

ORDER BY sales DESC

) AS rank

FROM sales_table;

B.

SELECT

region,

product,

RANK() OVER (

PARTITION BY product

ORDER BY sales DESC

) AS rank

FROM sales_table;

C.

SELECT

region,

product,

RANK() OVER (

PARTITION BY region

) AS rank

FROM sales_table;

D.

SELECT

region,

product,

RANK() OVER (

PARTITION BY region

ORDER BY sales DESC

) AS rank

FROM sales_table;

Suggested Answer: D

Get Premium Databricks Certified Data Analyst Associate Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
9 comments · newest first
VA
Vanda 4 days ago
Surprised that people are debating this, D seems obvious!
GI
Gianna 9 days ago
Definitely going with D, it’s clear and straightforward.
BR
Britt 15 days ago
Wait, how does Option A even work?
AL
Alton 20 days ago
I think Option B makes more sense for ranking by product.
CO
Cordelia 25 days ago
Option D is the right choice!
WI
Winifred 1 month ago
I’m confused about the difference between PARTITION BY product and region. I feel like option D makes the most sense for this scenario.
CO
Cornell 1 month ago
I practiced a similar question, and I believe we need to use PARTITION BY region and ORDER BY sales DESC to get the correct ranking.
CE
Cecilia 1 month ago
I’m not entirely sure, but I remember something about using RANK() with ORDER BY to sort sales. Maybe option D?
VE
Vernell 2 months ago
I think we need to rank products within each region, so I’m leaning towards an option that uses PARTITION BY region.
0/2000 characters

Save Cancel