Question: Find the number of pets for each student who has any pet and student id.
Schema: create table has_pet (stuid varchar, PRIMARY KEY (stuid)); create table student (stuid varchar, PRIMARY KEY (stuid))
SQL: select count(*), t1.stuid from student as t1 join has_pet as t2 on t1.stuid = t2.stuid group by t1.stuid