QuestionQ9

VerifiedRestricting and Sorting Data

You need to display 5 percent of the employees who have the highest salaries in the EMPLOYEES table.

Which query produces the required result?

Question Image

Explanation

ORDER BY salary DESC places employees with the greatest salaries first, and FETCH FIRST 5 PERCENT ROWS ONLY returns exactly 5 percent of the selected rows. WITH TIES could return additional employees whose salary matches the cutoff salary, so it does not guarantee exactly 5 percent.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!