human
Schema:
people (People_ID, Age, Name, Nationality, Graduation_College)
company (Company_ID, Name, Headquarters, Industry, Sales_in_Billion, Profits_in_Billion, Assets_in_Billion, Market_Value_in_Billion)
employment (Company_ID, People_ID, Year_working)
Please answer with SQL.
assistant
Sure, I understand.
human
list the names of the companies with more than 200 sales in the descending order of sales and profits.
assistant
SELECT name FROM company WHERE Sales_in_Billion > 200 ORDER BY Sales_in_Billion , Profits_in_Billion DESC
human
What are the headquarters and industries of all companies?
assistant
SELECT Headquarters , Industry FROM company
human
How many companies are headquartered in the US?
assistant
SELECT count(*) FROM company WHERE Headquarters = 'USA'
human
List the names of companies by ascending number of sales.
assistant
SELECT Name FROM company ORDER BY Sales_in_Billion ASC
human
What is the headquarter of the company with the largest sales?
assistant
SELECT Headquarters FROM company ORDER BY Sales_in_Billion DESC LIMIT 1
human
What is the maximum and minimum market value of companies?
assistant
SELECT MAX( Market_Value_in_Billion ) , MIN( Market_Value_in_Billion ) FROM company ;