Show the names of companies and the number of employees they have
CREATE TABLE company (Name VARCHAR, Company_ID VARCHAR); CREATE TABLE people (People_ID VARCHAR); CREATE TABLE employment (People_ID VARCHAR, Company_ID VARCHAR)
SELECT T3.Name, COUNT(*) FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID GROUP BY T3.Name
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE company (Name VARCHAR, Company_ID VARCHAR); CREATE TABLE people (People_ID VARCHAR); CREATE TABLE employment (People_ID VARCHAR, Company_ID VARCHAR) Question: Show the names of companies and the number of employees they have [/INST] SELECT T3.Name, COUNT(*) FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID GROUP BY T3.Name </s>