For each product which has problems, what are the number of problems and the product id?
CREATE TABLE problems (product_id VARCHAR); CREATE TABLE product (product_id VARCHAR)
SELECT COUNT(*), T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE problems (product_id VARCHAR); CREATE TABLE product (product_id VARCHAR) Question: For each product which has problems, what are the number of problems and the product id? [/INST] SELECT COUNT(*), T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id </s>