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
What is the average market value
assistant
SELECT AVG ( market_value ) FROM company;
human
Which location is most profitable? | What do you mean by location? We have different companies in different countries. | Which company is the most profitable?
assistant
SELECT Company FROM company ORDER by assets_billion desc LIMIT 1;
human
What is the average sales of the companies ranked 1, 2 and 3?
assistant
SELECT AVG ( sales_billion ) FROM company WHERE rank = 1 OR rank = 2 OR rank = 3 ;