Hay 3 tipos de aventuras para las que utilicé una función distinta en la consulta. Solo hay 1 cliente que ha reservado todo tipo de aventuras. La consulta que utilicé para obtener los datos es:
select c.customerid,c.name from customer c inner join booking b on c.customerid = b.customerid inner join destination d on b.destinationid=d.destinationid inner join adventure a on d.adventureid=a.adventureid group by c.customerid having count(distinct b.bid)=(select count(*) from bid) or count(distinct a.adventuretype)=( select count(distinct a.adventuretype) from adventure )Puede obtener las identificaciones de los clientes mediante la agregación y having :
select b.customerid from booking b join destination d on b.destinationid = d.destinationid join adventure a on d.adventureid = a.adventureid group by b.customerid having count(distinct a.advtype) = 3;O, si no desea codificar el "3", puede usar:
having count(distinct a.advtype) = (select count(distinct advtype from adventure) Te dejaré a ti agregar el nombre del cliente (usando join , exists o in ).