QuestionQ149

VerifiedRestricting and Sorting Data

Review the definition of the STUDENTS table:

Question Image

You must create a report listing the 10 students with the highest ranking in the INT_SQL course who completed the course during 1999.

Which SQL statement performs this task?

Explanation

For Oracle top-N reporting, the qualifying INT_SQL rows completed during 1999 must be ordered by MARKS descending in a subquery, with the outer query applying ROWNUM <= 10 and assigning the displayed rank. Applying ROWNUM in the same query block before the ORDER BY can select arbitrary rows before they are sorted.

Learn more

Community Discussion

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