Task: Text to Code
Input (English): For students who have pets, how many pets does each student have?
Output (English): SELECT count(*) ,  T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid GROUP BY T1.stuid