Question: How many residents does each property have? List property id and resident count.
Schema: create table properties (property_id varchar, PRIMARY KEY (property_id)); create table residents (property_id varchar, PRIMARY KEY (property_id))
SQL: select t1.property_id, count(*) from properties as t1 join residents as t2 on t1.property_id = t2.property_id group by t1.property_id