human
Schema:
Manufacturers (Code, Name, Headquarter, Founder, Revenue)
Products (Code, Name, Price, Manufacturer)
Please answer with SQL.
assistant
Sure, I understand.
human
how many different headquarter cities are there?
assistant
SELECT COUNT( distinct headquarter ) FROM manufacturers;
human
Find the number of different products that are from companies at each headquarter.
assistant
SELECT COUNT( DISTINCT T1.name ) , T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.Headquarter ;