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
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
List the companies and the investors of entrepreneurs.
assistant
SELECT Company , Investor FROM entrepreneur
human
What is the investor that has invested in the most number of entrepreneurs?
assistant
SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1
human
What are the investors that have invested in at least two entrepreneurs?
assistant
SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2
human
What are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor?
assistant
SELECT Investor , COUNT(*) FROM entrepreneur GROUP BY Investor
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 ;