Context: CREATE TABLE car_makers (country VARCHAR); CREATE TABLE countries (countryid VARCHAR)
Question: How many countries has more than 2 car makers ?
Answer: SELECT COUNT(*) FROM countries AS t1 JOIN car_makers AS t2 ON t1.countryid = t2.country GROUP BY t1.countryid HAVING COUNT(*) > 2