QuestionQ43

VerifiedRestricting and sorting data

Which two statements return the names of the three employees who have the lowest salaries?

Choose two
Explanation

An inline view that orders rows by ascending salary before the outer query applies ROWNUM <= 3 returns the three lowest-paid employees. Likewise, ORDER BY salary followed by FETCH FIRST 3 ROWS ONLY limits the already ordered result set. In the same query block, ROWNUM is assigned as rows are selected before a following ORDER BY; placing the ordering in a subquery is required when using ROWNUM for a top-N result.

Learn more

Community Discussion

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