How many countries has more than 2 car makers ?
CREATE TABLE car_makers (country VARCHAR); CREATE TABLE countries (countryid VARCHAR)
SELECT COUNT(*) FROM countries AS t1 JOIN car_makers AS t2 ON t1.countryid = t2.country GROUP BY t1.countryid HAVING COUNT(*) > 2
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE car_makers (country VARCHAR); CREATE TABLE countries (countryid VARCHAR) Question: How many countries has more than 2 car makers ? [/INST] SELECT COUNT(*) FROM countries AS t1 JOIN car_makers AS t2 ON t1.countryid = t2.country GROUP BY t1.countryid HAVING COUNT(*) > 2 </s>