Give the average number of working horses on farms with more than 5000 total horses.
return farms ;return working horses  on  #1 ;return number of  #2 for each  #1 ;return #1 where  #3 is higher than 5000 ;return working horses  on  #4 ;return number of  #5 for each  #1 ;return average of  #6
['select', 'project', 'group', 'comparative', 'project', 'group', 'aggregate']