Quest?o Prova Oracle Fetch First
PCD - PEDRO FREDERICO DE CARVALHO
Analista de Sistemas na FUNFARME | Especialista em Oracle SQL/PLSQL e Banco de Dados
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