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
Tell me the company Tim Naegeli works in.
assistant
SELECT T3.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 T2.Name = 'Tim Naegeli';
human
What are this company's sales numbers?
assistant
SELECT T3.Sales_in_Billion 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 T2.Name = 'Tim Naegeli';
human
Tell me the names of the employees that work for the companies with sales bigger than 200.
assistant
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 ;