DA0-002 Data Acquisition and Preparation Practice Question
A data analyst wants to retrieve the top 5 highest-paid employees from an 'employees' table, including ties. Which SQL clause should be used?
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
✓
TOP 5 WITH TIES
In many SQL dialects, LIMIT can be used to restrict rows. However, to include ties, some databases offer WITH TIES with FETCH FIRST or TOP. Standard SQL: FETCH FIRST 5 ROWS WITH TIES. TOP 5 alone does not include ties. RANK() with WHERE clause can work but is more complex.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
TOP 5 WITH TIES
Why this is correct
TOP 5 WITH TIES (SQL Server) includes all rows that tie for the 5th position.
- ✗
ORDER BY salary DESC LIMIT 5
Why it's wrong here
LIMIT 5 excludes ties beyond the fifth row.
- ✗
HAVING salary > 50000
Why it's wrong here
HAVING filters groups, not rows; not suitable.
- ✗
WHERE ROWNUM <= 5
Why it's wrong here
ROWNUM limits rows but does not handle ties.
Go deeper
Related to this question
About these practice questions
This DA0-002 question is part of Courseiva's 986-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 by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.