If every image has a single beetle and a single dungball.
return beetles ;return dungballs ;return images ;return number of  #1 for each  #3 ;return #3 where  #4 is equal to  one ;return number of  #2 for each  #5 ;return #5 where  #6 is equal to  one ;return number of  #3 ;return number of  #7 ;return if  #8 is equal to  #9
['select', 'select', 'select', 'group', 'comparative', 'group', 'comparative', 'aggregate', 'aggregate', 'boolean']