Which query will generate the required result?

You want to display 5 percent of the employees with the highest salaries in the
EMPLOYEES table. Which query will generate the required result?

You want to display 5 percent of the employees with the highest salaries in the
EMPLOYEES table. Which query will generate the required result?

A.
Option A

B.
Option B

C.
Option C

D.
Option D



Leave a Reply 6

Your email address will not be published. Required fields are marked *


wuxun

wuxun

B is correct! The key word first is necessary.

9jansen

9jansen

B

The syntax for the row limiting clause:
FETCH { FIRST | NEXT } [ { rowcount | percent PERCENT } ]
{ ROW | ROWS } { ONLY | WITH TIES } ]

MARA

MARA

Top-N Queries
The syntax for the row limiting clause looks a little complicated at first glance.

[ OFFSET offset { ROW | ROWS } ]
[ FETCH { FIRST | NEXT } [ { rowcount | percent PERCENT } ]
{ ROW | ROWS } { ONLY | WITH TIES } ]

Armando

Armando

Letter B is the right answer

The Tuk

The Tuk

SQL> select employee_id,last_name,salary from employees
2 order by salary desc
3 fetch first 5 percent rows only;

EMPLOYEE_ID LAST_NAME SALARY
———– ————————- ———-
100 King 24000
203 Mavris 24000
101 Kochhar 17000
102 De Haan 17000
145 Russell 14000
146 Partners 13500

6 rows selected.

SQL>