A data specialist is preparing a report of entries that exceed a threshold for the current quarter. The dataset contains repeated rows, so the specialist wants to exclude duplicates. Which method is the best for filtering these entries?
Group every column with GROUP BY and then apply an aggregate function to remove duplicates
Filter records by adding an ORDER BY clause on the threshold and delete repeated values in a separate step
Create a subquery to get rows under the threshold and exclude them from the main query
Use a SELECT DISTINCT statement with a WHERE clause to find rows over the threshold
Using SELECT with DISTINCT for the relevant columns and a WHERE clause is effective for retrieving rows that meet the threshold for the current quarter while eliminating repeated entries. ORDER BY and other aggregate approaches do not necessarily remove duplicates in the desired way. Subqueries that exclude certain values may not address repeated rows.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does SELECT DISTINCT do in SQL?
Open an interactive chat with Bash
How does a WHERE clause function in SQL?
Open an interactive chat with Bash
What are the limitations of the GROUP BY statement in SQL?