Database: pets_1
Question: For students who have pets , how many pets does each student have ? list their ids instead of names .
SQL:
select count(*) ,  t1.stuid from student as t1 join has_pet as t2 on t1.stuid  =  t2.stuid group by t1.stuid