human
Schema:
Manufacturers (Code, Name, Headquarter, Founder, Revenue)
Products (Code, Name, Price, Manufacturer)
Please answer with SQL.
assistant
Sure, I understand.
human
Find the total revenue of companies of each founder.
assistant
SELECT sum(revenue) , founder FROM manufacturers GROUP BY founder
human
Find the name and revenue of the company that earns the highest revenue in each city.
assistant
SELECT name , max(revenue) , Headquarter FROM manufacturers GROUP BY Headquarter
human
Find all manufacturers' names and their headquarters, sorted by the ones with highest revenue first.
assistant
SELECT name , headquarter FROM manufacturers ORDER BY revenue DESC
human
Find the total revenue for each manufacturer.
assistant
SELECT sum(revenue) , name FROM manufacturers GROUP BY name
human
Find the number of manufactures that are based in Tokyo or Beijing.
assistant
SELECT count(*) FROM manufacturers WHERE headquarter = 'Tokyo' OR headquarter = 'Beijing'
human
Return the total revenue of companies with headquarters in Tokyo or Taiwan.
assistant
SELECT SUM( revenue ) FROM manufacturers WHERE Headquarter = "Tokyo" OR Headquarter = "Taiwan" ;