Banco de dadosSql (3)
- (FGV 2022)
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.
A)
select cliente from frequencia f1
where not exists
(select * from oferta where f1.bar= bar)
B)
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))
C)
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))
D) select cliente from frequencia
E)
select cliente from frequencia f1
where not exists
(select * from frequencia
where not exists
(select * from oferta f2
where f1.cliente = f2.cliente
and oferta.bar = f2.bar))
Próximo:
EXERCÍCIOS - Exercício 162
Vamos para o Anterior: Exercício 160
Tente Este: Exercício 134
Primeiro: Exercício 1
VOLTAR ao índice: Banco de dados