Pular para o conteúdo principal

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

Banco de DadosSQL
Código
fg050007
Banca
FGV
Órgão
Prefeitura de Manaus - AM
Ano
2022
Nível
Superior
Cargo
Analista de Banco de Dados
Para o banco de dados happyhour, especificado anteriormente, assinale a expressão SQL que produz uma lista com os nomes dos clientes que frequentam todos os bares.
  1. Aselect cliente from frequencia f1where not exists(select * from oferta where f1.bar= bar)
  2. Bselect cliente from frequencia f1where not exists(select * from ofertawhere not exists(select * from frequencia f2where f1.cliente = f2.clienteand oferta.bar = f2.bar))
  3. Cselect cliente from frequencia f1where not exists(select * from ofertawhere not exists(select * from frequencia f2where f1.cliente <> f2.clienteand oferta.bar <> f2.bar))
  4. Dselect cliente from frequencia
  5. Eselect cliente from frequencia f1where not exists(select * from frequenciawhere not exists(select * from oferta f2where f1.cliente = f2.clienteand oferta.bar = f2.bar))
Revelar gabarito e comentário

GabaritoB — select cliente from frequencia f1 where not exists (select * from oferta where not exists (select * from frequencia f2 where f1.cliente = f2.cliente and oferta.bar = f2.bar))

Link permanente: /questoes/fg050007