What is the output of this query?

Examine the following query:SQL> SELECT prod_id, amount_sold
FROM sales
ORDER BY amount_sold
FETCH FIRST 5 PERCENT ROWS ONLY;
What is the output of this query?

Examine the following query:SQL> SELECT prod_id, amount_sold
FROM sales
ORDER BY amount_sold
FETCH FIRST 5 PERCENT ROWS ONLY;
What is the output of this query?

A.
It displays 5 percent of the products with the highest amount sold.

B.
It displays the first 5 percent of the rows from the SALES table.

C.
It displays 5 percent of the products with the lowest amount sold.

D.
It results in an error because the ORDER BY clause should be the last clause.

Explanation:
https://oracle-base.com/articles/12c/row-limiting-clause-for-top-n-queries-12cr1



Leave a Reply 0

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