Pular para o conteúdo principal

Questão de Banco de Dados — SQL — FGV 2022

Banco de DadosSQL
Código
fg055538
Banca
FGV
Órgão
TJ-DFT
Ano
2022
Nível
Superior
Cargo
Analista Judiciário - Análise de Sistemas
Com relação à tabela TURFE, descrita anteriormente, o comando SQL que exibe, para cada páreo, somente o cavalo vencedor com o respectivo tempo é:
  1. Aselect pareo, cavalo, tempofrom TURFEwhere not exists(select * from TURFE twhere t.pareo = TURFE.pareoand t.tempo < TURFE.tempo)
  2. Bselect pareo, cavalo, tempofrom TURFEwhere exists(select * from TURFE twhere t.pareo = TURFE.pareoand t.tempo > TURFE.tempo)
  3. Cselect pareo, cavalo, tempofrom TURFEwhere not exists(select * from TURFE twhere t.pareo <> TURFE.pareoand t.tempo = TURFE.tempo)
  4. Dselect pareo, cavalo, tempofrom TURFEwhere exists(select * from TURFE twhere t.pareo = TURFE.pareoand t.tempo < TURFE.tempo)
  5. Eselect pareo, cavalo, tempofrom TURFEwhere not exists(select * from TURFE twhere t.pareo = TURFE.pareoand t.tempo <> TURFE.tempo)
Revelar gabarito e comentário

GabaritoA — select pareo, cavalo, tempo from TURFE where not exists (select * from TURFE t where t.pareo = TURFE.pareo and t.tempo < TURFE.tempo)

Link permanente: /questoes/fg055538