How many residents does each property have? List property id and resident count.
CREATE TABLE properties (property_id VARCHAR); CREATE TABLE residents (property_id VARCHAR)
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
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE properties (property_id VARCHAR); CREATE TABLE residents (property_id VARCHAR) Question: How many residents does each property have? List property id and resident count. [/INST] 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 </s>