human
Schema:
company (Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value)
gas_station (Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name)
station_company (Station_ID, Company_ID, Rank_of_the_Year)
Please answer with SQL.
assistant
Sure, I understand.
human
Show all headquarters.
assistant
SELECT headquarters FROM company;
human
Show headquarters with a company in the banking industry.
assistant
SELECT headquarters FROM company WHERE main_industry = 'Banking';
human
How about headquarters with a company in oil and gas?
assistant
SELECT headquarters FROM company WHERE main_industry = 'Oil AND gas';
human
Show headquarters with both.
assistant
SELECT headquarters FROM company WHERE main_industry = "Banking" INTERSECT SELECT headquarters FROM company WHERE main_industry = "Oil AND gas" ;