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
Show the name of the company with company_id 1.0?
assistant
SELECT Name FROM company WHERE Company_ID = 1.0;
human
Show the names of companies and that of employees in descending order of number of years working for that employee?
assistant
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;
human
Show all companies with Headquarters USA? | Did you mean to show the company IDs? | yes
assistant
SELECT Company_ID FROM company WHERE Headquarters = "USA" ;