human
Schema:
entrepreneur (Entrepreneur_ID, People_ID, Company, Money_Requested, Investor)
people (People_ID, Name, Height, Weight, Date_of_Birth)
Please answer with SQL.
assistant
Sure, I understand.
human
Show the investors shared by entrepreneurs that requested more than 140000 and entrepreneurs that requested less than 120000.
assistant
SELECT Investor FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested < 120000
human
List the names of entrepreneurs and their companies in descending order of money requested?
assistant
SELECT T2.Name , T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested
human
What is the total money requested by entrepreneurs with height more than 1.85?
assistant
SELECT sum(T1.Money_Requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 1.85
human
List the companies of entrepreneurs in descending order of money requested.
assistant
SELECT Company FROM entrepreneur ORDER BY Money_Requested DESC
human
What are the weights of entrepreneurs in descending order of money requested?
assistant
SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC
human
Return the average money requested across all entrepreneurs.
assistant
SELECT avg ( Money_Requested ) FROM entrepreneur ;