human
Schema:
Manufacturers (Code, Name, Headquarter, Founder, Revenue)
Products (Code, Name, Price, Manufacturer)
Please answer with SQL.
assistant
Sure, I understand.
human
Select the average price of each manufacturer's products, showing the manufacturer's name.
assistant
SELECT avg(T1.Price) , T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name
human
Select the name of the products with a price less than or equal to $200.
assistant
SELECT name FROM products WHERE price <= 200
human
Select the name of each manufacturer along with the name and price of its most expensive product.
assistant
SELECT T1.Name , max(T1.Price) , T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name
human
Select the name and price of the cheapest product.
assistant
SELECT name , price FROM Products ORDER BY price ASC LIMIT 1
human
Select the names of all the products in the store.
assistant
SELECT Name FROM Products
human
Select the names and the prices of all the products in the store.
assistant
SELECT name , price FROM products ;