DA0-002 Data Acquisition and Preparation Practice Question
In a table 'sales_team' with columns 'salesperson', 'quarter', and 'revenue', an analyst wants to assign a rank to each salesperson within their quarter based on revenue, with the highest revenue getting rank 1. However, if two salespeople have the same revenue, they should receive the same rank, and the next rank should be the next consecutive integer (no gaps). Which window function should be used?
⚠ Common exam trap
DA0-002 often tests the distinction between RANK, DENSE_RANK, and ROW_NUMBER; candidates may choose RANK() when no gaps are required, forgetting that RANK() leaves gaps.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
DENSE_RANK()
DENSE_RANK() assigns ranks without gaps, so if two salespeople tie for rank 1, the next rank is 2. This matches the requirement that ties receive the same rank and the next rank is consecutive. It is the correct window function for this scenario.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
RANK()
Why it's wrong here
RANK() leaves gaps after ties, assigning the next distinct value the position after the tied rows, so equal revenues would produce 1, 1, 3 rather than consecutive ranks. It is tempting because RANK() handles ties correctly, but the stem requires no gaps, which DENSE_RANK() provides.
- ✗
NTILE(4)
Why it's wrong here
NTILE(4) divides rows into four roughly equal buckets, so it always produces ranks 1 to 4 regardless of ties or revenue values. It is tempting because it is a window function that numbers rows, but it is designed for quartile segmentation, not competition ranking with ties collapsed and no gaps.
- ✓
DENSE_RANK()
Why this is correct
DENSE_RANK() assigns identical ranks to tied revenues and continues with the next consecutive integer, producing no gaps. RANK() would skip numbers after a tie, and ROW_NUMBER() would break ties arbitrarily, so neither meets the stated requirement.
- ✗
ROW_NUMBER()
Why it's wrong here
ROW_NUMBER() assigns a distinct sequential integer to every row, so tied revenues receive different ranks and the no-gaps-with-ties requirement is broken. It is tempting because it is the standard window function for numbering rows, and it would be correct when every row must receive a unique position regardless of ties.
About these practice questions
This DA0-002 question is part of Courseiva's 1,004-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official CompTIA exam blueprint
This DA0-002 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DA0-002 exam.