human
Schema:
Manufacturers (Code, Name, Headquarter, Founder, Revenue)
Products (Code, Name, Price, Manufacturer)
Please answer with SQL.
assistant
Sure, I understand.
human
Find the number of products for each manufacturer, showing the name of each company.
assistant
SELECT count(*) , T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name
human
Find the name, headquarter and founder of the manufacturer that has the highest revenue.
assistant
SELECT name , headquarter , founder FROM manufacturers ORDER BY revenue DESC LIMIT 1
human
Find the name, headquarter and revenue of all manufacturers sorted by their revenue in the descending order.
assistant
SELECT name , headquarter , revenue FROM manufacturers ORDER BY revenue DESC
human
Find the total revenue created by the companies whose headquarter is located at Austin.
assistant
SELECT sum(revenue) FROM manufacturers WHERE headquarter = 'Austin'
human
Find the total revenue of companies of each founder.
assistant
SELECT sum(revenue) , founder FROM manufacturers GROUP BY founder
human
Find the total revenue for each manufacturer.
assistant
SELECT SUM( revenue ) , name FROM manufacturers GROUP BY name ;