Quest?o Prova Oracle Fetch First

Quest?o Prova Oracle Fetch First

Quest?o de prova certifica??o Oracle.

Assunto FETCH FIRST

You want to display 5 percent of the rows from the SALES table for products with the lowest AMOUNT_SOLD and also want to include the rows that have the same AMOUNT_SOLD even if this causes the output to exceed 5 percent of the rows. Which query will provide the required result?

A. SELECT prod_id, cust_id, amount_sold FROM sales ORDER BY amount_sold FETCH FIRST 5 PERCENT

ROWS WITH TIES;

CORRETO QUEST?O A, usa-se o WITH TIES pois no enunciado pediu "include the rows that have the same AMOUNT_SOLD" ent?o o comando duplica caso haja repeti??o nesta coluna

B. SELECT prod_id, cust_id, amount_sold FROM sales ORDER BY amount_sold FETCH FIRST 5 PERCENT

ERRADO B n?o existe esta sequencia de comando ROWS ONLY WITH TIES.

C. SELECT prod_id, cust_id, amount_sold FROM sales ORDER BY amount_sold FETCH FIRST 5 PERCENT

ERRADO C n?o existe esta sequencia de comando ROWS ONLY WITH TIES.

D. SELECT prod_id, cust_id, amount_sold FROM sales ORDER BY amount_sold FETCH FIRST 5 PERCENT

ERRADO D, a consulta esta correta mas pelo enunciado pede-se para incluir linhas com o mesmo valor ent?o tem que usar o WITH TIES.


#certifica??ooracle #aprendaoracle #provaoracle


要查看或添加评论,请登录

PCD - PEDRO FREDERICO DE CARVALHO的更多文章

社区洞察

其他会员也浏览了