I have two tables one with observers and another with animals.
Im trying to get the name of observers who have either seen more than 5 animals OR seen a bear.
I am able to get observers with more than 4 animals but not sure how to do the OR statement.
This is my code:
SELECT o.last_name, o.first_name, a.observer_id, count (a.observer_id) as Animals_Seen
from animals as a inner join observer as o
on a.observer_id = o.observer_id
group by a.observer_id, o.last_name, o.first_name
having count (a.observer_id) > 4;
This is what I get:

Set a boolean value to 1 whenever a bear is spotted… then check whether the observer’s bear count > 0: