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 é:
- Aselect pareo, cavalo, tempofrom TURFEwhere not exists(select * from TURFE twhere t.pareo = TURFE.pareoand t.tempo < TURFE.tempo)
- Bselect pareo, cavalo, tempofrom TURFEwhere exists(select * from TURFE twhere t.pareo = TURFE.pareoand t.tempo > TURFE.tempo)
- Cselect pareo, cavalo, tempofrom TURFEwhere not exists(select * from TURFE twhere t.pareo <> TURFE.pareoand t.tempo = TURFE.tempo)
- Dselect pareo, cavalo, tempofrom TURFEwhere exists(select * from TURFE twhere t.pareo = TURFE.pareoand t.tempo < TURFE.tempo)
- Eselect pareo, cavalo, tempofrom TURFEwhere not exists(select * from TURFE twhere t.pareo = TURFE.pareoand t.tempo <> TURFE.tempo)