Return the country name and the numbers of languages spoken for each country that speaks at least 3 languages.
CREATE TABLE country (Name VARCHAR, Code VARCHAR); CREATE TABLE countrylanguage (Language VARCHAR, CountryCode VARCHAR)
SELECT COUNT(T2.Language), T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Name HAVING COUNT(*) > 2
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE country (Name VARCHAR, Code VARCHAR); CREATE TABLE countrylanguage (Language VARCHAR, CountryCode VARCHAR) Question: Return the country name and the numbers of languages spoken for each country that speaks at least 3 languages. [/INST] SELECT COUNT(T2.Language), T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Name HAVING COUNT(*) > 2 </s>