Task: Text to Code
Input (English): Step 1: find the summation of Total_Horses of each value of Farm_ID in farm table.
Step 2: find Total_Horses, Pigs of farm table ordered ascending by the results of step 1
Output (English): SELECT Total_Horses , Pigs FROM farm GROUP BY Farm_ID ORDER BY Sum ( Total_Horses ) Asc