[Schema (values) (types)]: | company_employee |  people : people_id (text) , age (number) , name (number) , nationality (text) , graduation_college (text) | company : company_id (text) , name (number) , headquarters (number) , industry (text) , sales_in_billion (text) , profits_in_billion (text) , assets_in_billion (number) , market_value_in_billion (text) | employment : company_id (text) , people_id (number) , year_working (number);
[Primary Keys]: people : people_id, company : company_id, employment : company_id
[Foreign Keys]: employment : people_id = people : people_id | employment : company_id = company : company_id

Question: How many companies are headquartered in the US?
SQL: SELECT count(*) FROM company WHERE Headquarters  =  'USA'

Question: List the names of companies by ascending number of sales.
SQL: SELECT Name FROM company ORDER BY Sales_in_Billion ASC

Question: What are the headquarters and industries of all companies?
SQL: SELECT Headquarters ,  Industry FROM company

Question: Show the names of companies in the banking or retailing industry?
SQL: SELECT Name FROM company WHERE Industry  =  "Banking" OR Industry  =  "Retailing"

Question: What is the maximum and minimum market value of companies?
SQL: SELECT max(Market_Value_in_Billion) ,  min(Market_Value_in_Billion) FROM company

Question: What is the headquarter of the company with the largest sales?
SQL: SELECT Headquarters FROM company ORDER BY Sales_in_Billion DESC LIMIT 1

Question: Show the different headquarters and number of companies at each headquarter.
SQL: SELECT Headquarters ,  COUNT(*) FROM company GROUP BY Headquarters

Question: Show the most common headquarter for companies.
SQL: SELECT Headquarters FROM company GROUP BY Headquarters ORDER BY COUNT(*) DESC LIMIT 1

Question: Show the headquarters that have at least two companies.
SQL: SELECT Headquarters FROM company GROUP BY Headquarters HAVING COUNT(*)  >=  2

Question: Show the headquarters that have both companies in banking industry and companies in oil and gas industry.
SQL: SELECT Headquarters FROM company WHERE Industry  =  "Banking" INTERSECT SELECT Headquarters FROM company WHERE Industry  =  "Oil and gas"

Question: Show the names of companies and of employees.
SQL: SELECT T3.Name ,  T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID JOIN company AS T3 ON T1.Company_ID  =  T3.Company_ID

Question: Show names of companies and that of employees in descending order of number of years working for that employee.
SQL: SELECT T3.Name ,  T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID JOIN company AS T3 ON T1.Company_ID  =  T3.Company_ID ORDER BY T1.Year_working

Question: Show the names of employees that work for companies with sales bigger than 200.
SQL: SELECT T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID JOIN company AS T3 ON T1.Company_ID  =  T3.Company_ID WHERE T3.Sales_in_Billion  >  200

Question: Show the names of companies and the number of employees they have
SQL: SELECT T3.Name ,  COUNT(*) FROM employment AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID JOIN company AS T3 ON T1.Company_ID  =  T3.Company_ID GROUP BY T3.Name

Question: List the names of people that are not employed by any company
SQL: SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM employment)

Question: list the names of the companies with more than 200 sales in the descending order of sales and profits.
SQL: SELECT name FROM company WHERE Sales_in_Billion  >  200 ORDER BY Sales_in_Billion ,  Profits_in_Billion DESC